Skip to content

Commit

Permalink
fixing pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelknafo committed Feb 21, 2025
1 parent 6da263a commit ade46eb
Showing 1 changed file with 43 additions and 23 deletions.
66 changes: 43 additions & 23 deletions .github/workflows/owasp_pygoat_ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,52 @@ jobs:
name: Set version
runs-on: ubuntu-latest
if: ${{ github.event.inputs.teardown != 'true' }}
permissions:
id-token: write #This is required for requesting the JWT
contents: write # This is required to create/push the new git tag
steps:
- name: checkout
uses: actions/checkout@v4.1.0
- uses: actions/checkout@v4.1.0
- uses: actions/checkout@v4
with:
fetch-depth: 0
# # This item has no matching transformer
# - task: gitversion/setup@3
# enabled: true
# displayName: Install GitTools
# inputs:
# versionSpec: 5.x
# # This item has no matching transformer
# - task: gitversion/execute@3
# enabled: true
# displayName: Calculate SemVer
- name: Display calculated version
run: echo current version is ${{ env.GitVersion_SemVer }}
- name: Init git global config
run: |-
git config --global user.email ${{ env.Build_RequestedForEmail }}
git config --global user.name ${{ github.actor }}
- name: Create Git tag for current version
run: |-
git tag -a ${{ env.GitVersion_SemVer }} -m "Main version ${{ env.GitVersion_SemVer }}"
git push origin ${{ env.GitVersion_SemVer }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
versionSpec: "5.x"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v3.0.0
- name: Display GitVersion outputs
run: |
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
- name: Create or update tag
uses: actions/github-script@v3
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
with:
script: |
const tagName = `v${{ steps.gitversion.outputs.semVer }}`;
const ref = `refs/tags/${tagName}`;
const { data: refs } = await github.git.listMatchingRefs({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${tagName}`
});
if (refs.length > 0) {
await github.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${tagName}`,
sha: context.sha,
force: true
});
} else {
await github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: ref,
sha: context.sha
});
}
deployInfra-deploy:
name: Deploy Infra job
needs:
Expand Down

0 comments on commit ade46eb

Please sign in to comment.