generated from opensafely-core/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ehrQL approach to creating PRs automatically
See #118. Based on https://github.com/opensafely-core/ehrql/blob/6a6e0140ed85166028c4316e51820d02199c0483/.github/workflows/update-external-studies.yml The creating a PR step currently fails, most likely because the associated `JOB_SERVER_PR_TOKEN` has expired.
- Loading branch information
1 parent
b6ff8e6
commit 7351af6
Showing
1 changed file
with
21 additions
and
9 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 |
---|---|---|
|
@@ -37,15 +37,27 @@ jobs: | |
id: create_pr | ||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 | ||
with: | ||
token: "${{ secrets.JOB_SERVER_PR_TOKEN }}" | ||
branch: bot/update-interactive-templates | ||
base: main | ||
add-paths: requirements.prod.* | ||
author: "opensafely-github-bot <[email protected]>" | ||
committer: "opensafely-github-bot <[email protected]>" | ||
commit-message: "feat: Update interactive templates to ${{ env.UPDATED_VERSION }}" | ||
title: "Update interactive templates to ${{ env.UPDATED_VERSION }}" | ||
body: "Update interactive-templates to ${{ env.UPDATED_VERSION }}" | ||
|
||
# untested | ||
#- name: Enable automerge | ||
# if: steps.create_pr.outputs.pull-request-operation == 'created' | ||
# env: | ||
# GH_TOKEN: "${{ secrets.JOB_SERVER_PR_TOKEN }} " | ||
# run: gh pr merge --merge --auto --squash ${{ steps.create_pr.outputs.pull-request-number }} | ||
body: | | ||
To get tests to run on this PR there's an odd workflow: | ||
- Approve it | ||
- Close it | ||
- Re-open it | ||
- Re-enable automerge | ||
You can read more on why this is needed in the `create-pull-request` [docs][1]. | ||
[1]: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs | ||
# The PR will still require manual approval, this just reduces it to a one-click process | ||
- name: Enable automerge | ||
if: steps.create_pr.outputs.pull-request-operation == 'created' | ||
run: gh pr merge --auto --squash ${{ steps.create_pr.outputs.pull-request-number }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |