npm-update #508
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 3 * * 2,4,6' | |
# can be run manually on https://github.com/cockpit-project/cockpit/actions | |
workflow_dispatch: | |
jobs: | |
npm-update: | |
environment: npm-update | |
permissions: | |
pull-requests: write | |
contents: write | |
# 22.04's podman has issues with piping and causes tar errors | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Run npm-update bot | |
run: | | |
test/common/make-bots | |
git config --global user.name "GitHub Workflow" | |
git config --global user.email "cockpituous@cockpit-project.org" | |
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.COCKPIT_DEPLOY_KEY }}' | |
git push --force 'git@github.com:${{ github.repository }}' HEAD | |
ssh-add -D | |
ssh-agent -k |