From b390ac00fba345662c8e54b311532df98a442a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 11:14:37 -0300 Subject: [PATCH 01/19] test: use changelog action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..eded82d49 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,17 @@ +name: Changelog +on: + push: + branches: + - 211-sim-ops-generate-pr-from-staging-to-main-with-changelog + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - name: "✏️ Generate release changelog" + uses: heinrichreimer/action-github-changelog-generator@v2.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: "echo changelog" + run: echo "${{ steps.changelog.outputs.changelog }}" From 84df2eb5930d8524212df175f4092076d3b84fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 11:18:02 -0300 Subject: [PATCH 02/19] fix: set id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eded82d49..435afb2e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "✏️ Generate release changelog" + id: changelog uses: heinrichreimer/action-github-changelog-generator@v2.3 with: token: ${{ secrets.GITHUB_TOKEN }} From 631180496dec9dc23d96329b1b6caa1dd6ccf796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 11:50:39 -0300 Subject: [PATCH 03/19] fix: only unreleased changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 435afb2e1..12904c3ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,7 @@ jobs: id: changelog uses: heinrichreimer/action-github-changelog-generator@v2.3 with: + unreleasedOnly: true token: ${{ secrets.GITHUB_TOKEN }} - name: "echo changelog" From f8e5e216068e0dc5948e3ea6d353e2704e0cf758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 12:18:19 -0300 Subject: [PATCH 04/19] improvement: rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12904c3ae..6bb7ae589 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,7 @@ jobs: uses: heinrichreimer/action-github-changelog-generator@v2.3 with: unreleasedOnly: true + unreleasedLabel: "Next release" token: ${{ secrets.GITHUB_TOKEN }} - name: "echo changelog" From 0498dfa77291f33e686fcd3879a4a7cccf428052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 12:21:41 -0300 Subject: [PATCH 05/19] test: add checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bb7ae589..d45e1db8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ jobs: changelog: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: "✏️ Generate release changelog" id: changelog uses: heinrichreimer/action-github-changelog-generator@v2.3 @@ -18,3 +19,6 @@ jobs: - name: "echo changelog" run: echo "${{ steps.changelog.outputs.changelog }}" + + # - name: Create Pull Request + # uses: peter-evans/create-pull-request@v6 From 57684199cb97cac7ad2d2a35954eb4ba67a2bfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 14:00:41 -0300 Subject: [PATCH 06/19] test: set release branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d45e1db8f..7ca9205d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,10 @@ jobs: with: unreleasedOnly: true unreleasedLabel: "Next release" + stripGeneratorNotice: true + issues: false + # futureRelease: + releaseBranch: release-0.1.1 token: ${{ secrets.GITHUB_TOKEN }} - name: "echo changelog" From 5e2871c419ce7ecc1d3bf0e99f1e4c17405b47ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 14:44:55 -0300 Subject: [PATCH 07/19] improvement: use GH cli and api to create release notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 52 +++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ca9205d0..14c09b222 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,24 +5,42 @@ on: - 211-sim-ops-generate-pr-from-staging-to-main-with-changelog jobs: - changelog: + release-notes-pr: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 - - name: "✏️ Generate release changelog" - id: changelog - uses: heinrichreimer/action-github-changelog-generator@v2.3 - with: - unreleasedOnly: true - unreleasedLabel: "Next release" - stripGeneratorNotice: true - issues: false - # futureRelease: - releaseBranch: release-0.1.1 - token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout repository + uses: actions/checkout@v4 - - name: "echo changelog" - run: echo "${{ steps.changelog.outputs.changelog }}" + - name: Get latest release + id: get_latest_release + run: | + latest_release=$(gh release view --json tagName --jq .tagName) + e + echo "tag=$latest_release" >> "$GITHUB_OUTPUT" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Create Pull Request - # uses: peter-evans/create-pull-request@v6 + - name: Generate release notes + id: generate_release_notes + run: | + notes=$(curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \ + -d '{"tag_name":"v0.1.1","commitish":"release-0.1.1","previous_tag_name":"v0.1.0"}' \ + ) + echo "notes=$notes" >> "$GITHUB_OUTPUT" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create pull request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + draft: true + branch: release-${{ steps.get_latest_release.outputs.tag }} + title: Release ${{ steps.get_latest_release.outputs.tag }} + body: ${{ steps.generate_release_notes.outputs.notes }} From e60eced04c136003c81e233d08a2621c6254bd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:04:25 -0300 Subject: [PATCH 08/19] fix[gh action]: set correct variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/test.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14c09b222..291c8f1d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,13 +2,25 @@ name: Changelog on: push: branches: - - 211-sim-ops-generate-pr-from-staging-to-main-with-changelog + - release-* jobs: release-notes-pr: runs-on: ubuntu-latest steps: + - name: Extract branch + id: extract_branch + run: echo "branch=${GITHUB_REF#refs/heads/}" >> "$GITHUB_OUTPUT" + env: + GITHUB_REF: ${{ github.ref_name }} + + - name: Extract tag from branch name + id: extract_tag + run: echo "tag=${BRANCH#release-}" >> "$GITHUB_OUTPUT" + env: + BRANCH: ${{ steps.extract_branch.outputs.branch }} + - name: Checkout repository uses: actions/checkout@v4 @@ -23,14 +35,15 @@ jobs: - name: Generate release notes id: generate_release_notes + # https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release run: | notes=$(curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GITHUB_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \ - -d '{"tag_name":"v0.1.1","commitish":"release-0.1.1","previous_tag_name":"v0.1.0"}' \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \ + -d '{"tag_name":"${{ steps.extract_tag.outputs.tag }}","target_commitish":"${{ steps.extract_branch.outputs.branch }}","previous_tag_name":"${{ steps.get_latest_release.outputs.tag}}"}' \ ) echo "notes=$notes" >> "$GITHUB_OUTPUT" env: From 4b12c1e1826ecb519d55123f695240251d499363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:05:30 -0300 Subject: [PATCH 09/19] refactor: rename file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/{test.yml => release-pr.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test.yml => release-pr.yml} (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/release-pr.yml similarity index 100% rename from .github/workflows/test.yml rename to .github/workflows/release-pr.yml From b522899a1d80c82979375087334e1edd864c0eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:10:12 -0300 Subject: [PATCH 10/19] fix: remove typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 291c8f1d0..4fcc8f955 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -28,7 +28,6 @@ jobs: id: get_latest_release run: | latest_release=$(gh release view --json tagName --jq .tagName) - e echo "tag=$latest_release" >> "$GITHUB_OUTPUT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From dda43df1e57f67f71605284f1c417c4c58d718d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:34:57 -0300 Subject: [PATCH 11/19] test[gh-action]: set token in command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 4fcc8f955..df16df423 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -39,14 +39,13 @@ jobs: notes=$(curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \ -d '{"tag_name":"${{ steps.extract_tag.outputs.tag }}","target_commitish":"${{ steps.extract_branch.outputs.branch }}","previous_tag_name":"${{ steps.get_latest_release.outputs.tag}}"}' \ ) + echo $notes echo "notes=$notes" >> "$GITHUB_OUTPUT" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create pull request uses: peter-evans/create-pull-request@v6 From 394b958448c77bdfd66fee8b35497edfd5764844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:37:29 -0300 Subject: [PATCH 12/19] test[gh-action]: remove new line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index df16df423..a5a4a0cd6 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -42,8 +42,7 @@ jobs: -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \ - -d '{"tag_name":"${{ steps.extract_tag.outputs.tag }}","target_commitish":"${{ steps.extract_branch.outputs.branch }}","previous_tag_name":"${{ steps.get_latest_release.outputs.tag}}"}' \ - ) + -d '{"tag_name":"${{ steps.extract_tag.outputs.tag }}","target_commitish":"${{ steps.extract_branch.outputs.branch }}","previous_tag_name":"${{ steps.get_latest_release.outputs.tag}}"}' ) echo $notes echo "notes=$notes" >> "$GITHUB_OUTPUT" From 9c5b88ed6cf5efffcff979a74e5da8e2d663fec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:40:45 -0300 Subject: [PATCH 13/19] test[gh-action]: set permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index a5a4a0cd6..a105f2bc2 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -7,6 +7,9 @@ on: jobs: release-notes-pr: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: Extract branch @@ -28,6 +31,7 @@ jobs: id: get_latest_release run: | latest_release=$(gh release view --json tagName --jq .tagName) + echo $latest_release echo "tag=$latest_release" >> "$GITHUB_OUTPUT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9aab6e06f6760646c01d70576aaa67c117d1dbed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:44:47 -0300 Subject: [PATCH 14/19] fix[gh-action]: parse response from api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index a105f2bc2..fa91180f6 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -8,7 +8,7 @@ jobs: release-notes-pr: runs-on: ubuntu-latest permissions: - contents: write + contents: read pull-requests: write steps: @@ -40,14 +40,15 @@ jobs: id: generate_release_notes # https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release run: | - notes=$(curl -L \ + response=$(curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \ -d '{"tag_name":"${{ steps.extract_tag.outputs.tag }}","target_commitish":"${{ steps.extract_branch.outputs.branch }}","previous_tag_name":"${{ steps.get_latest_release.outputs.tag}}"}' ) - echo $notes + echo $response + notes=$(echo $response | jq -r .body) echo "notes=$notes" >> "$GITHUB_OUTPUT" - name: Create pull request From a8eacdd8f355a0cd2263773838c800d49364fbd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:46:29 -0300 Subject: [PATCH 15/19] fix[gh-action]: branch name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index fa91180f6..d628bc447 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -56,6 +56,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} draft: true - branch: release-${{ steps.get_latest_release.outputs.tag }} + branch: ${{ steps.extract_branch.outputs.branch }} title: Release ${{ steps.get_latest_release.outputs.tag }} body: ${{ steps.generate_release_notes.outputs.notes }} From 057e8c5a7371be81d3d8aacd14f3b3b8c72bdce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:47:39 -0300 Subject: [PATCH 16/19] fix[gh-action]: set base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index d628bc447..ef8a4bc2b 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -57,5 +57,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} draft: true branch: ${{ steps.extract_branch.outputs.branch }} + base: main title: Release ${{ steps.get_latest_release.outputs.tag }} body: ${{ steps.generate_release_notes.outputs.notes }} From f5ce3882a683660979b2279abd68e0f3522bb691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 15:58:41 -0300 Subject: [PATCH 17/19] test[gh-action]: remove branch parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index ef8a4bc2b..223a29c70 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -56,7 +56,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} draft: true - branch: ${{ steps.extract_branch.outputs.branch }} base: main title: Release ${{ steps.get_latest_release.outputs.tag }} body: ${{ steps.generate_release_notes.outputs.notes }} From bda75875e915d146a629c9824ee2f30fd1df3618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Wed, 24 Jul 2024 16:01:52 -0300 Subject: [PATCH 18/19] test[gh-action]: use gh cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 223a29c70..7da14d6f1 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -52,10 +52,8 @@ jobs: echo "notes=$notes" >> "$GITHUB_OUTPUT" - name: Create pull request - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.GITHUB_TOKEN }} - draft: true - base: main - title: Release ${{ steps.get_latest_release.outputs.tag }} - body: ${{ steps.generate_release_notes.outputs.notes }} + id: create_pull_request + run: | + gh pr create --title "Release ${{ steps.extract_tag.outputs.tag }}" --body "${{ steps.generate_release_notes.outputs.notes }}" --base main --head ${{ steps.extract_branch.outputs.branch }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e483c631cebcdfc9cfc7cb60bfb42c7be47b436e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Fri, 26 Jul 2024 11:54:09 -0300 Subject: [PATCH 19/19] fix[gh-action]: fix multi line output and permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .github/workflows/release-pr.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 7da14d6f1..6c78044b8 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -8,7 +8,7 @@ jobs: release-notes-pr: runs-on: ubuntu-latest permissions: - contents: read + contents: write pull-requests: write steps: @@ -48,8 +48,13 @@ jobs: https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \ -d '{"tag_name":"${{ steps.extract_tag.outputs.tag }}","target_commitish":"${{ steps.extract_branch.outputs.branch }}","previous_tag_name":"${{ steps.get_latest_release.outputs.tag}}"}' ) echo $response - notes=$(echo $response | jq -r .body) - echo "notes=$notes" >> "$GITHUB_OUTPUT" + + # Multi line output https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string + { + echo 'notes<> "$GITHUB_OUTPUT" - name: Create pull request id: create_pull_request