* updating set-output to echo to $GITHUB_OUTPUT instead Signed-off-by: vsoch <vsoch@users.noreply.github.com>
45 lines
1.6 KiB
YAML
45 lines
1.6 KiB
YAML
on:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
persist-new-suite-yml:
|
|
name: Commit Suite Release YML
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# Likely other steps go here
|
|
- name: Set BRANCH_NAME
|
|
run: |
|
|
tag_name=${{github.event.release.tag_name}}
|
|
echo "Tag: $tag_name"
|
|
|
|
version=$(echo "$tag_name" | sed 's/^v//')
|
|
echo "Version: $version"
|
|
|
|
echo "suite_version=${version}" >> $GITHUB_OUTPUT
|
|
echo "suite_update_branch=suite_${version}" >> $GITHUB_OUTPUT
|
|
id: data
|
|
|
|
- name: Permanently save the new suite release
|
|
run: |
|
|
mkdir -p releases
|
|
new_suite_version_yml="releases/suite_${{ steps.data.outputs.suite_version }}.yml"
|
|
echo "Suite target file: $new_suite_version_yml"
|
|
cp suite.yml "${new_suite_version_yml}"
|
|
git add "${new_suite_version_yml}"
|
|
git commit -m "Suite v${{ steps.data.outputs.suite_version }} auto-commit of new release files"
|
|
|
|
- name: Push files
|
|
run: git push --force "https://${{ github.actor }}:${{secrets.GITHUB_TOKEN}}@github.com/${{ github.repository }}.git" "HEAD:${{ steps.data.outputs.suite_update_branch }}"
|
|
|
|
- name: Open a PR to the default branch
|
|
uses: vsoch/pull-request-action@d703f40f3af5ae294f9816395ddf2e3d2d3feafa # 1.0.21
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PULL_REQUEST_FROM_BRANCH: ${{ steps.data.outputs.suite_update_branch }}
|
|
PULL_REQUEST_BRANCH: master
|
|
PULL_REQUEST_TITLE: 'Action: Update suite release file for v${{ steps.data.outputs.suite_version }}'
|
|
PULL_REQUEST_BODY: Auto-generated PR!
|