Sync appVersion #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync appVersion | |
# TODO: add description of this action | |
on: | |
workflow_dispatch: | |
inputs: | |
app_version: | |
description: Scalr Agent version in format x.y.z (without `agent/` prefix). | |
required: true | |
type: string | |
upstream: | |
description: | | |
This input is used to link the dispatch with the upstream. It will be | |
as prefix in PR name. | |
required: true | |
type: string | |
env: | |
PR_BRANCH: 'actions/sync-app-version-${{ inputs.app_version }}' | |
jobs: | |
sync-app-version: | |
name: Sync appVersion | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: printenv | |
shell: bash | |
run: printenv | |
- name: Main | |
uses: ./.github/actions/sync-app-version | |
with: | |
app_version: ${{inputs.app_version}} | |
upstream: ${{inputs.upstream}} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Commit Changes | |
# shell: bash | |
# run: |- | |
# git config user.name "github-actions[bot]" | |
# git config user.email "github-actions[bot]@users.noreply.github.com" | |
# git checkout -b $PR_BRANCH | |
# git status | |
# git add . | |
# git commit -m "Release: ${{steps.update.outputs.version}}" | |
# git push origin $PR_BRANCH --force | |
# - name: 'Create Pull Request' | |
# uses: 'actions/github-script@v6' | |
# with: | |
# script: |- | |
# const tag = "v" + process.env.NEW_VERSION; | |
# try { | |
# const listResponse = await github.rest.pulls.list({ | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# state: "open", | |
# head: context.repo.owner + ":" + process.env.PR_BRANCH, | |
# base: process.env.GITHUB_REF_NAME, | |
# }); | |
# core.isDebug() && console.log(listResponse); | |
# if (!listResponse.data.length) { | |
# const createResponse = await github.rest.pulls.create({ | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# title: "Release: " + tag, | |
# body: process.env.RELEASE_NOTES, | |
# head: process.env.PR_BRANCH, | |
# base: process.env.GITHUB_REF_NAME, | |
# }); | |
# core.info( | |
# `Created PR #${createResponse.data.number} at ${createResponse.data.html_url}` | |
# ); | |
# } else { | |
# const updateResponse = await github.rest.pulls.update({ | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# pull_number: listResponse.data[0].number, | |
# title: "Release: " + tag, | |
# body: process.env.RELEASE_NOTES, | |
# }); | |
# core.info( | |
# `Updated PR #${updateResponse.data.number} at ${updateResponse.data.html_url}` | |
# ); | |
# } | |
# } catch (err) { | |
# console.error(err); | |
# core.setFailed(`Failed to create pull request: ${err}`); | |
# } |