mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
449ba284ce
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
36 lines
865 B
YAML
36 lines
865 B
YAML
# Reference: https://github.com/Yash-Singh1/eslint-plugin-userscripts/blob/main/.github/workflows/readme-in-sync.yml
|
|
|
|
name: Check if README and docs/README are in sync
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- gh-pages
|
|
pull_request:
|
|
branches:
|
|
- gh-pages
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Check for difference in README.md and docs/README.md
|
|
run: |
|
|
if [ -z "$(diff README.md docs/README.md --brief)" ]
|
|
then
|
|
echo "README.md and docs/README.md are in sync"
|
|
else
|
|
echo "Make sure that README.md and docs/README.md are in sync"
|
|
echo
|
|
echo "Difference:"
|
|
echo
|
|
diff README.md docs/README.md -u
|
|
exit 1
|
|
fi
|