-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move II updates into a separate workflow
- Loading branch information
Showing
2 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
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
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" |