Skip to content

Commit 9242319

Browse files
Merge pull request #20 from codecov/th/fix-push-tag
fix: push new tags to extensions
2 parents 195c10d + c5a31c4 commit 9242319

File tree

2 files changed

+58
-14
lines changed

2 files changed

+58
-14
lines changed

.github/workflows/push-tag-to-extensions.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,42 @@ on: # yamllint disable-line rule:truthy
66
# Pattern matched against refs/tags
77
tags:
88
- '*'
9+
910
jobs:
10-
bitrise-step:
11+
set-version:
1112
runs-on: ubuntu-latest
13+
outputs:
14+
CODECOV_WRAPPER_VERSION: ${{ steps.version_output.outputs.CODECOV_WRAPPER_VERSION }}
1215
steps:
13-
- name: Run version
14-
run: ./scripts/version.sh
1516
- name: Checkout
16-
uses: ./.github/workflows/push-tag.yml@main
17-
with:
18-
repository: "codecov/codecov-bitrise"
19-
version: ${{ env.CODECOV_WRAPPER_VERSION }}
17+
uses: actions/checkout@v4
18+
- name: Set version variable
19+
id: version_output
20+
run: |
21+
version=$(cat scripts/version.sh | grep 'CODECOV_WRAPPER_VERSION=' | cut -d\" -f2)
22+
echo $version
23+
echo "CODECOV_WRAPPER_VERSION=$version" >> $GITHUB_OUTPUT
24+
25+
bitrise-step:
26+
needs: set-version
27+
uses: ./.github/workflows/push-tag.yml
28+
with:
29+
repository: "codecov-bitrise"
30+
version: "${{ needs.set-version.outputs.CODECOV_WRAPPER_VERSION }}"
31+
secrets: inherit
32+
33+
circleci-orb:
34+
needs: set-version
35+
uses: ./.github/workflows/push-tag.yml
36+
with:
37+
repository: "codecov-circleci-orb"
38+
version: "${{ needs.set-version.outputs.CODECOV_WRAPPER_VERSION }}"
39+
secrets: inherit
40+
41+
github-action:
42+
needs: set-version
43+
uses: ./.github/workflows/push-tag.yml
44+
with:
45+
repository: "codecov-action"
46+
version: "${{ needs.set-version.outputs.CODECOV_WRAPPER_VERSION }}"
47+
secrets: inherit

.github/workflows/push-tag.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
22
# yamllint disable rule:line-length
33
name: Push tag to extension
44
on: # yamllint disable-line rule:truthy
@@ -17,11 +17,27 @@ jobs:
1717
permissions:
1818
contents: write
1919
pull-requests: write
20+
id-token: write
21+
2022
steps:
23+
- name: Echo inputs
24+
run: |
25+
echo "repository: ${{ inputs.repository }}"
26+
echo "version: ${{ inputs.version }}"
27+
28+
- name: Generate a token
29+
id: app-token
30+
uses: actions/create-github-app-token@v1
31+
with:
32+
app-id: ${{ secrets.RELEASER_APP_ID }}
33+
private-key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
34+
repositories: ${{ inputs.repository }}
35+
2136
- name: Checkout
2237
uses: actions/checkout@v4
2338
with:
24-
repository: ${{ inputs.repository }}
39+
repository: codecov/${{ inputs.repository }}
40+
token: ${{ steps.app-token.outputs.token }}
2541

2642
- name: Import GPG key
2743
id: import-gpg
@@ -36,19 +52,19 @@ jobs:
3652
run: git checkout -b release/wrapper/${{ inputs.version }}
3753

3854
- name: Pull latest wrapper
39-
run: |
40-
git submodule update --init --recursive --remote
55+
run: git submodule update --init --recursive --remote
4156

4257
- name: Make commit
4358
run: |
59+
git add src/scripts
4460
git commit -S --message "chore(release): wrapper-${{ inputs.version }}"
45-
git push origin release/wrapper/${{ inputs.version }}
61+
git push origin release/wrapper/${{ inputs.version }} -f
4662
4763
- name: Install GitHub CLI
4864
uses: dev-hanz-ops/[email protected]
4965

5066
- name: Create pull request into main
5167
run: |
52-
gh pr create --title "chore(release): wrapper-${{ inputs.version}}" --body "---" --base "main"
68+
gh pr create --fill --base "main" --reviewer "codecov/report-upload"
5369
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)