Skip to content

Update README.md

Update README.md #11

Workflow file for this run

name: Update README.md
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 0"
permissions:
actions: read
checks: read
contents: write
deployments: none
issues: read
packages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: none
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
- name: update readme
run: php misc/updateReadme.php
- name: Prepare git config
run: |
cat <<- EOF > $HOME/.netrc
machine github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
machine api.github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
EOF
chmod 600 $HOME/.netrc
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
- name: push changes & create PR
run: |
changes=($( git diff --numstat ))
if [[ ${changes[0]} -gt 1 ]]
then
cd $GITHUB_WORKSPACE
git push origin --delete updatereadme || true
git branch -D updatereadme || true
git checkout -b updatereadme
git add README.md
git commit -m "update README.md"
git push --set-upstream origin updatereadme
curl \
--request POST \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title":"Update README.md",
"body":"updates detections in README.md",
"head":"updatereadme",
"base":"master"
}' \
--url https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls
fi
shell: bash