44 lines
1.4 KiB
YAML
44 lines
1.4 KiB
YAML
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
|