Fix links #113
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Asset checker | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [closed] | |
schedule: | |
- cron: '10 2 * * 3' | |
jobs: | |
assetChecker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Set up GitHub CLI | |
run: | | |
sudo apt-get install -y gh | |
- name: Identify dangling assets | |
run: | | |
python .github/workflows/check-assets.py | |
continue-on-error: false | |
- name: Check for dangling_assets file | |
id: dangling_assets | |
run: | | |
if [ -f ./dangling_assets.md ]; then | |
echo "Dangling assets file found" | |
echo "found=true" >> $GITHUB_ENV | |
else | |
echo "Dangling assets file not found" | |
echo "found=false" >> $GITHUB_ENV | |
fi | |
continue-on-error: false | |
- name: Search for existing "Assets report" issue | |
id: find_issue | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Set the token | |
run: | | |
gh issue list --state open --search "Assets report" --json number --jq '.[0].number' > issue_number.txt || echo "" > issue_number.txt | |
issue_number=$(cat issue_number.txt) | |
echo "Issue number: $issue_number" | |
echo "issue_number=$issue_number" >> $GITHUB_ENV | |
- name: Create new issue if not found | |
if: env.issue_number == '' | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: Assets report | |
content-filepath: ./dangling_assets.md | |
labels: report, automated issue | |
- name: Update existing issue | |
if: env.issue_number != '' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Set the token | |
run: | | |
gh issue edit ${{ env.issue_number }} --body-file ./dangling_assets.md |