Skip to content

Commit

Permalink
fix(minor-major): add major or minor tag update
Browse files Browse the repository at this point in the history
  • Loading branch information
AEnguerrand committed Aug 27, 2024
1 parent 979a846 commit 38a70e2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix: ${{fromJson(needs.changelist.outputs.changed_actions)}}
steps:
- name: get ghapp-cybersecurity-ci token
- name: "[CI] Get Github Token based on Github App authentication"
id: ghapp-cybersecurity-ci
uses: getsentry/action-github-app-token@v3
with:
Expand All @@ -60,10 +60,46 @@ jobs:
monorepo-tags: true
path: ${{ matrix.component }}
include-v-in-tag: false
- uses: actions/checkout@v4
- name: "[Release] Checkout code"
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4
with:
fetch-depth: 100
- name: tag major and minor versions
if: ${{ steps.release.outputs.releases_created }}
run: |
echo ${{ steps.release.outputs }}
- name: "[Release] Update Major tags"
uses: actions/github-script@v7
with:
github-token: ${{ steps.ghapp-cybersecurity-ci.outputs.token }}
script: |
// Major
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ steps.release.outputs.major }}',
sha: context.sha
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/v${{ steps.release.outputs.major }}',
sha: context.sha
});
})
// Minor
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ steps.release.outputs.minor }}',
sha: context.sha
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/v${{ steps.release.outputs.minor }}',
sha: context.sha
});
})
2 changes: 1 addition & 1 deletion actions/jfrog-upload/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
JF_URL: "https://artifactory.ledgerlabs.net"
with:
oidc-provider-name: github
oidc-audience: artifactory-2
oidc-audience: artifactory-3
- run: |
jfrog rt u ${{ inputs.path }} ${{ inputs.artifactory_repository}}
shell: bash

0 comments on commit 38a70e2

Please sign in to comment.