Skip to content

Commit 2188383

Browse files
authored
New workflow (#72)
* New workflow * Remove newline * Properly quote the PR body * Remove MAIN_BRANCH and add comment * Clarify * Remove permissions
1 parent 46d299f commit 2188383

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

.github/workflows/build-publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v6
1414
- name: Set up Python
1515
uses: actions/setup-python@v4
1616
with:
@@ -50,3 +50,10 @@ jobs:
5050
path: dist/
5151
- name: Publish distribution to PyPI
5252
uses: pypa/gh-action-pypi-publish@release/v1
53+
run-update-etos-defaults:
54+
needs: [publish-to-pypi]
55+
uses: ./.github/workflows/update-etos.yaml
56+
secrets: inherit
57+
with:
58+
test-runner-version: ${{ github.event.release.tag_name }}
59+
test-runner-release-body: ${{ github.event.release.body }}

.github/workflows/update-etos.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Update ETOS defaults
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
test-runner-version:
7+
description: 'ETOS test runner version'
8+
required: true
9+
type: string
10+
test-runner-release-body:
11+
description: 'The release body that triggered this workflow'
12+
required: true
13+
type: string
14+
15+
env:
16+
REPOSITORY_OWNER: eiffel-community
17+
ETOS_REPOSITORY: etos
18+
ETOS_TEST_RUNNER_REPOSITORY: etos-test-runner
19+
20+
jobs:
21+
update-etos-defaults:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v6
25+
- name: Generate a token
26+
id: generate-token
27+
uses: actions/create-github-app-token@v2
28+
with:
29+
owner: ${{ env.REPOSITORY_OWNER }}
30+
repositories: ${{ env.ETOS_REPOSITORY }}
31+
app-id: ${{ vars.ETOS_PR_APP_ID }}
32+
private-key: ${{ secrets.ETOS_PR_APP_PRIVATE_KEY }}
33+
- uses: actions/checkout@v6
34+
with:
35+
repository: ${{ env.REPOSITORY_OWNER }}/${{ env.ETOS_REPOSITORY }}
36+
token: ${{ steps.generate-token.outputs.token }}
37+
- name: Update manifests
38+
uses: fjogeleit/yaml-update-action@main
39+
with:
40+
commitChange: false
41+
token: ${{ steps.generate-token.outputs.token }}
42+
changes: |
43+
{
44+
"defaults/test_runner.yaml": {
45+
".version": "${{ inputs.test-runner-version }}"
46+
}
47+
}
48+
- name: Create Pull Request
49+
uses: peter-evans/create-pull-request@v8
50+
with:
51+
token: ${{ steps.generate-token.outputs.token }}
52+
commit-message: Update to ETOS test runner ${{ inputs.test-runner-version }}
53+
title: "Integrate \"${{ inputs.test-runner-version }}\""
54+
body: "Automated update of ETOS version for Test Runner\n
55+
56+
Release: https://github.com/${{ env.REPOSITORY_OWNER }}/${{ env.ETOS_TEST_RUNNER_REPOSITORY }}/releases/tag/${{ inputs.test-runner-version }}\n
57+
58+
${{ inputs.test-runner-release-body }}"
59+
sign-commits: true
60+
branch: "update-etos-test-runner-${{ github.run_id }}"
61+
labels: automated-pr, dependencies, etos-test-runner

0 commit comments

Comments
 (0)