Skip to content

Commit

Permalink
github: add action for OpenWrt base update (freifunk-gluon#3235)
Browse files Browse the repository at this point in the history
Create a GitHub action to automatically create updates to the OpenWrt
base-version on manual run.

This allows to create base-modules updates where Gluon patches did not
change from the GitHub UI.

Skip PR creation. Automatically created PRs do not invoke subsequent
actions, thus not creating build-tests.

Signed-off-by: David Bauer <[email protected]>
  • Loading branch information
blocktrron authored Mar 28, 2024
1 parent c468f68 commit c09bc14
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/bump-gluon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: "Update OpenWrt base"

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to create update for"
required: true
default: "master"

jobs:
update-openwrt:
runs-on: ubuntu-22.04
env:
COMMIT_NAME: Gluon CI Bot
COMMIT_EMAIL: [email protected]
steps:
- name: Clone Gluon
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- name: Configure Git User and E-Mail
run: git config --global user.name "${{ env.COMMIT_NAME }}" && git config --global user.email "${{ env.COMMIT_EMAIL }}"

- name: Get update branch name
id: branch-name
run: echo "branch-name=update-openwrt-${{ github.event.inputs.branch }}-$(date +%s)" >> $GITHUB_OUTPUT

- name: Link example Site
run: ln -s docs/site-example site

- name: Invoke update-modules
run: make update-modules

- name: Refresh patches
run: make refresh-patches

- name: Check if unstaged commits exist
run: git diff --exit-code || echo "::warning::Patches need a manual refresh"

- name: Checkout individual branch name
run: git checkout -b ${{ steps.branch-name.outputs.branch-name }}

- name: Push branch
run: git push origin HEAD

- name: Emit PR creation message
run:
echo "::notice::Create pull-request at https://github.com/${{ github.repository }}/compare/${{ github.event.inputs.branch }}...${{ steps.branch-name.outputs.branch-name }}?quick_pull=1"

0 comments on commit c09bc14

Please sign in to comment.