-
Notifications
You must be signed in to change notification settings - Fork 17
50 lines (43 loc) · 1.85 KB
/
post-release-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# This Github action updates the target-branch references for dependabot and other actions
name: Post Release Action
on:
workflow_dispatch:
inputs:
branch_name:
description: 'Name of the new release branch, i.e. release-v1.0.0'
required: true
jobs:
update-references:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update branch references
run: |
BRANCH_NAME=${{ github.event.inputs.branch_name }}
grep -rl 'target-branch:' . | xargs sed -i "s/target-branch: \".*\"/target-branch: \"${BRANCH_NAME}\"/g"
# Needed for signing commits using Github App tokens
# See: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#commit-signing
- uses: actions/create-github-app-token@v1.11.1
id: generate-token
with:
app-id: ${{ vars.CSM_RELEASE_APP_ID }}
private-key: ${{ secrets.CSM_RELEASE_APP_PRIVATE_KEY }}
- name: Create PR for Release Updates
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
branch: 'update-target-branch'
title: 'Update target-branch references for dependabot'
body: |
This PR updates target-branch references to the new release branch.
Auto-generated by [dell/helm-charts](https://github.com/dell/helm-charts)
sign-commits: true
commit-message: "Update target-branch references to new release branch"