49 lines
1.6 KiB
YAML
49 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 "::set-output name=suite_version::${version}"
|
||
|
|
echo "::set-output name=suite_update_branch::suite_${version}"
|
||
|
|
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@1.0.2
|
||
|
|
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!"
|