Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more info to auto-PR links #52

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions .github/workflows/update-downstream.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Update downstream

on:
push:
branches: [main]
workflow_dispatch:
pull_request:
types:
- closed

jobs:
update-downstream-repos:
if: ${{ github.event.pull_request.merged }}
environment: detsys-pr-bot
name: Pull request detsys-ts update to ${{ github.repository_owner }}/${{ matrix.repo }}
runs-on: ubuntu-22.04
Expand All @@ -22,13 +23,18 @@ jobs:
env:
REF: ${{ github.sha }}
REF_URL: https://github.com/${{ github.repository }}/tree/${{ github.sha }}
SOURCE_REPO: ${{ github.repository }}
SOURCE_PR_NUMBER: ${{ github.event.pull_request.number }}
SOURCE_PR_URL: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}
HEAD_REF: ${{ github.head_ref }}
HEAD_COMMIT_MSG: ${{ github.event.head_commit.message }}
DIFF_URL: https://github.com/${{ github.repository }}/compare/${{ github.head_ref }}..${{ github.sha }}
GIT_USER: ${{ github.actor }}
GIT_EMAIL: ${{ github.actor }}@users.noreply.github.com
GIT_BRANCH: detsys-ts-update-${{ github.sha }}
GIT_BASE: main
GIT_HEAD: detsys-pr-bot:detsys-ts-update-${{ github.sha }}
TARGET_REPO: ${{ github.repository_owner }}/${{ matrix.repo }}
SOURCE_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.detsys_pr_bot_token }} # for `gh pr create`
steps:
- name: Check out ${{ env.TARGET_REPO }}
Expand All @@ -48,12 +54,11 @@ jobs:
git config user.name "${{ env.GIT_USER }}"
git config user.email "${{ env.GIT_EMAIL }}"


- name: Make sure the repo is forked
run: |
gh repo fork

- name: Update detsys-ts dependency for ${{ env.TARGET_REPO }} to ref ${{ env.REF }}
- name: Update `detsys-ts` dependency for ${{ env.TARGET_REPO }} to ref `${{ env.REF }}`
run: |
nix develop --command pnpm update detsys-ts
nix develop --command pnpm all
Expand All @@ -62,9 +67,14 @@ jobs:
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.detsys_pr_bot_token }}
title: "Update detsys-ts: ${{ github.event.head_commit.message }}"
commit-message: "Update detsys-ts for: ${{ github.event.head_commit.message }} (${{ env.REF }})"
body: Bump detsys-ts to [${{ env.REF }}](${{ env.REF_URL }}) and regenerate application bundle.
title: "Update `detsys-ts`: ${{ env.HEAD_COMMIT_MSG }}"
commit-message: "Update `detsys-ts` for: `${{ env.HEAD_COMMIT_MSG }}` (`${{ env.REF }}`)"
body: |
Bump [`detsys-ts`](${{ env.SOURCE_REPO }}) to the latest `HEAD` and regenerate application bundle.

* Source ref: [`${{ env.REF }}`](${{ env.REF_URL }})
* Source pull request: [`${{ env.SOURCE_REPO }}#${{ env.SOURCE_PR_NUMBER }}`](${{ env.SOURCE_PR_URL }})
* Source diff: [`${{ env.HEAD_REF }}..${{ env.REF }}`](${{ env.DIFF_URL }})
push-to-fork: detsys-pr-bot/${{ matrix.repo }}
branch: "${{ env.GIT_BRANCH }}"
base: ${{ env.GIT_BASE }}
Expand Down
Loading