Skip to content

Commit

Permalink
Move II updates into a separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bitdivine committed Oct 24, 2023
1 parent 25044f5 commit 46f40ff
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,8 @@ jobs:
with:
assets_dir: 'out'
token: ${{ secrets.GITHUB_TOKEN }}
update-ii:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update II
run: ./scripts/update-ii
- name: Commit updated Internet Identity
uses: EndBug/[email protected]
with:
add: .
author_name: Nightly GitHub Action
author_email: "<[email protected]>"
message: "Update Internet Identity"
# do not pull: if this branch is behind, then we might as well let
# the pushing fail
pull_strategy: "NO-PULL"
nightly-passes:
needs: ["tag-main", "update-ii"]
needs: ["tag-main"]
if: ${{ always() }}
runs-on: ubuntu-20.04
steps:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/update-ii.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# A GitHub Actions workflow that regularly checks for new Internet Identity
# and creates a PR when there is.
name: II Update
on:
schedule:
# check for new II versions weekly
- cron: '30 3 * * MON'
workflow_dispatch:
push:
branches:
# The development branch for this workflow:
- "update-ii"
jobs:
ii-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update II
run: |
./scripts/update-ii
if [ -n "$(git status --porcelain)" ]
then
echo A new Internet Identity is available
echo "updated=1" >> "$GITHUB_OUTPUT"
else
echo "updated=0" >> "$GITHUB_OUTPUT"
fi
# If Internet Identity was updated, create a PR.
- name: Create Pull Request
if: ${{ steps.update.outputs.updated == '1' }}
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GIX_BOT_PAT }}
base: main
add-paths: ./dfx.json
commit-message: Update Internet Identity
committer: GitHub <[email protected]>
author: gix-bot <[email protected]>
branch: bot-ii-update
delete-branch: true
title: 'Update II version'
# Since the this is a scheduled job, a failure won't be shown on any
# PR status. To notify the team, we send a message to our Slack channel on failure.
- name: Notify Slack on failure
uses: dfinity/internet-identity/.github/actions/slack@release-2023-08-28
if: ${{ failure() }}
with:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: "Internet Identity update failed"

0 comments on commit 46f40ff

Please sign in to comment.