npm-update #342
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: npm-update | |
on: | |
schedule: | |
- cron: '0 2 * * 2,4,6' | |
# can be run manually on https://github.com/cockpit-project/cockpit-machines/actions | |
workflow_dispatch: | |
jobs: | |
npm-update: | |
environment: npm-update | |
permissions: | |
pull-requests: write | |
contents: write | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Run npm-update bot | |
run: | | |
make test/common/make-bots tools/node-modules | |
test/common/make-bots | |
git config --global user.name "GitHub Workflow" | |
git config --global user.email "[email protected]" | |
mkdir -p ~/.config/cockpit-dev | |
echo ${{ github.token }} >> ~/.config/cockpit-dev/github-token | |
eval $(ssh-agent) | |
ssh-add - <<< '${{ secrets.NODE_CACHE_DEPLOY_KEY }}' | |
bots/npm-update ~@patternfly >&2 | |
ssh-add -D | |
ssh-agent -k | |
- name: Force push the change to trigger testing workflows | |
run: | | |
# Don't force-push if no branch was created | |
test "$(git symbolic-ref HEAD)" = '${{ github.ref }}' && exit | |
sleep 1 # make sure the timestamp changes | |
git commit --amend --no-edit | |
eval $(ssh-agent) | |
ssh-add - <<< '${{ secrets.SELF_DEPLOY_KEY }}' | |
git push --force '[email protected]:${{ github.repository }}' HEAD | |
ssh-add -D | |
ssh-agent -k |