-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb262ed
commit 473999d
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
assets/images/logo-3.png | ||
assets/images/logo-2.png | ||
assets/images/logo-4.png | ||
assets/images/theses.png |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
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: | | ||
if [ -f ./dangling_assets.md ]; then | ||
gh issue edit ${{ env.issue_number }} --body-file ./dangling_assets.md | ||
else | ||
echo "No dangling assets file to update issue." | ||
fi |