Skip to content

Commit

Permalink
workflows: add workflow for update-targets
Browse files Browse the repository at this point in the history
  • Loading branch information
grische committed Jul 4, 2024
1 parent aca7b1b commit 563721e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/update-targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: "Update Targets"

on:
workflow_dispatch:
push:
branches:
- stable
- legacy
- next
paths:
- 'Makefile'

permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests

jobs:
update-Modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get update branch name
id: branch-name
run: echo "branch-name=update-targets-${{ github.event.inputs.branch }}" >> $GITHUB_OUTPUT

- name: Run update-targets
run: make update-targets

- name: Get new targets
id: new-targets
run:
echo "names=$(git diff --color=always|perl -wlne 'print $1 if /^\e\[32m\+\e\[m\e\[32m(.*)\e\[m$/' | tr '\n' ' ')" >> $GITHUB_OUTPUT

- name: Create Pull Request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
title: '[${{ github.event.inputs.branch }}] Update targets'
body: |
Updated targets for branch ${{ github.event.inputs.branch }}
New targets: `${{ steps.new-targets.outputs.names }}`
Please trigger the CI before merging this pull request.
commit-message: "targets: add ${{ steps.new-targets.outputs.names }}"
branch: ${{ steps.branch-name.outputs.branch-name }}
labels: ${{ github.event.inputs.branch }}
draft: true # this step does not trigger a CI run, so always mark them as draft
delete-branch: true

0 comments on commit 563721e

Please sign in to comment.