From aac4db27e7786d08adfde7ca584d5ae938251383 Mon Sep 17 00:00:00 2001 From: "vlad.lezhnin" Date: Thu, 22 May 2025 12:21:30 +0100 Subject: [PATCH] Morph: set-output issue --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ .github/workflows/on-demand.yml | 14 +++++++++----- .github/workflows/release-please.yml | 12 +++++++----- 3 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000000..6340fb84c667 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +# Sample workflow for refactoring set-output to use environment variables + +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set version environment variables + run: | + echo "VERSION_NAME=${{ env.VERSION_NAME }}" >> $GITHUB_ENV + echo "VERSION_CODE=${{ env.VERSION_CODE }}" >> $GITHUB_ENV + - name: Use version environment variables + run: | + echo "Version Name: $VERSION_NAME" + echo "Version Code: $VERSION_CODE" \ No newline at end of file diff --git a/.github/workflows/on-demand.yml b/.github/workflows/on-demand.yml index 5b9889a43a84..8e565de46e8d 100644 --- a/.github/workflows/on-demand.yml +++ b/.github/workflows/on-demand.yml @@ -18,7 +18,9 @@ jobs: - name: Get branch name # see https://github.com/actions/checkout/issues/331 id: get-branch - run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName') + run: | + BRANCH=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName') + echo "branch=$BRANCH" >> $GITHUB_ENV env: REPO: ${{ github.repository }} PR_NO: ${{ github.event.issue.number }} @@ -28,7 +30,7 @@ jobs: with: fetch-depth: 1 # grab the PR branch - ref: ${{ steps.get-branch.outputs.branch }} + ref: ${{ env.branch }} # We can't use GITHUB_TOKEN here because, github actions can't trigger actions # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow # So this is a personal access token @@ -79,7 +81,9 @@ jobs: - name: Get branch name # see https://github.com/actions/checkout/issues/331 id: get-branch - run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName') + run: | + BRANCH=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName') + echo "branch=$BRANCH" >> $GITHUB_ENV env: REPO: ${{ github.repository }} PR_NO: ${{ github.event.issue.number }} @@ -89,7 +93,7 @@ jobs: with: fetch-depth: 1 # grab the PR branch - ref: ${{ steps.get-branch.outputs.branch }} + ref: ${{ env.branch }} # We can't use GITHUB_TOKEN here because, github actions can't trigger actions # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow # So this is a personal access token @@ -114,4 +118,4 @@ jobs: push_options: "" status_options: '--untracked-files=no' skip_dirty_check: false - create_branch: no + create_branch: no \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 98a9fb1c895a..ab5ce5c12b58 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -6,7 +6,7 @@ on: env: RUBY_VERSION: 3.2.0 - + jobs: release-please: @@ -45,8 +45,8 @@ jobs: needs: release-please if: ${{ needs.release-please.outputs.release_created }} outputs: - VERSION_NAME: ${{ steps.set_output.outputs.VERSION_NAME }} - VERSION_CODE: ${{ steps.set_output.outputs.VERSION_CODE }} + VERSION_NAME: ${{ env.VERSION_NAME }} + VERSION_CODE: ${{ env.VERSION_CODE }} steps: - uses: actions/checkout@v4 @@ -105,7 +105,9 @@ jobs: - name: Set output id: set_output - run: echo "::set-output name=VERSION_NAME::${{ env.VERSION_NAME }}" && echo "::set-output name=VERSION_CODE::${{ env.VERSION_CODE }}" + run: | + echo "VERSION_NAME=${{ env.VERSION_NAME }}" >> $GITHUB_ENV + echo "VERSION_CODE=${{ env.VERSION_CODE }}" >> $GITHUB_ENV android-release: concurrency: @@ -199,4 +201,4 @@ jobs: STORE_JKS_DECRYPTKEY: ${{secrets.NEW_CYPHER }} SIGN_STORE_PASSWORD: ${{secrets.DECRYPT_FOR_SCANNER_FILE }} SIGN_KEY_ALIAS: ${{secrets.ALIAS_FOR_SCANNER }} - SIGN_KEY_PASSWORD: ${{secrets.KEY_FOR_SCANNER }} + SIGN_KEY_PASSWORD: ${{secrets.KEY_FOR_SCANNER }} \ No newline at end of file