1
0
Fork 0
mirror of https://github.com/ipfs/awesome-ipfs.git synced 2024-11-20 11:28:35 -05:00

fix: broken-links workflow (#433)

* fix: broken-links workflow

* fix: trim bash var

* fix: string comparison

* fix: github action if condition syntax

* debugging

* debugging: gh action showing 1 changed file.. what is it?

* fix: only count changed data files for scheduled broken link PRs
This commit is contained in:
Russell Dempsey 2022-09-16 09:28:26 -07:00 committed by GitHub
parent 3845f4d173
commit dd28c19ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -38,10 +38,17 @@ jobs:
awesome_bot --allow 429 --allow-redirect --allow-dupe --allow-ssl -w ipfs.io README.md || echo awesome_bot --allow 429 --allow-redirect --allow-dupe --allow-ssl -w ipfs.io README.md || echo
- name: Remove broken links - name: Remove broken links
id: remove-broken-links
run: | run: |
node scripts/remove-broken-links.js node scripts/remove-broken-links.js
echo "Changed files:"
git ls-files -m
changed_data_files_count=$(git ls-files -m data | wc -l | tr -d ' ')
echo "changed_data_files_count='$changed_data_files_count'"
echo "::set-output name=changed_files::$changed_data_files_count"
- uses: stefanzweifel/git-auto-commit-action@49620cd3ed21ee620a48530e81dba0d139c9cb80 - uses: stefanzweifel/git-auto-commit-action@49620cd3ed21ee620a48530e81dba0d139c9cb80
if: steps.remove-broken-links.outputs.changed_data_files_count > 0
with: with:
# Optional. Commit message for the created commit. # Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes" # Defaults to "Apply automatic changes"
@ -70,6 +77,7 @@ jobs:
create_branch: true create_branch: true
- name: pull-request - name: pull-request
if: steps.remove-broken-links.outputs.changed_data_files_count > 0
uses: repo-sync/pull-request@65785d95a5a466e46a9d0708933a3bd51bbf9dde uses: repo-sync/pull-request@65785d95a5a466e46a9d0708933a3bd51bbf9dde
with: with:
source_branch: "remove-broken-links-${{ github.run_id }}" source_branch: "remove-broken-links-${{ github.run_id }}"

View file

@ -25,4 +25,6 @@ if (markdownTable.error) {
await fs.writeFile(filePath, fileContents, 'utf8') await fs.writeFile(filePath, fileContents, 'utf8')
} }
})() })()
} else {
console.log('No errors reported by awesome_bot.')
} }