From b1251cb1b251b6790e59673732c27c696e89789e Mon Sep 17 00:00:00 2001 From: Lukasz Sielski Date: Thu, 12 Sep 2024 11:14:24 +0200 Subject: [PATCH] change to python --- .github/workflows/actions/ado_tag/action.yml | 54 +++++++++++--------- scripts/script.py | 5 ++ 2 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 scripts/script.py diff --git a/.github/workflows/actions/ado_tag/action.yml b/.github/workflows/actions/ado_tag/action.yml index 45f1582..da7cd63 100644 --- a/.github/workflows/actions/ado_tag/action.yml +++ b/.github/workflows/actions/ado_tag/action.yml @@ -16,30 +16,36 @@ inputs: runs: using: composite steps: - - name: Get PR's body for commit identified by ${{ inputs.commit-sha }} SHA - id: get-pr-body - env: + - env: GH_TOKEN: ${{ inputs.gh-token }} - run: | - PRBODY=$(gh pr list --json body --repo ${{ inputs.repository }} --state merged --search ${{ inputs.commit-sha }} --jq '.[].body') - echo "PRs body: $PRBODY" - echo "PRBODY=${PRBODY}" >> $GITHUB_ENV - shell: bash - - name: Extract work item reference number from PR's body - id: extract-reference-number - run: | - reference_num=$(echo $PRBODY | sed -n "s/^.*AB#\([0-9]*\).*$/\1/p") - if [ -z "$reference_num" ] - then - echo "Reference number not found!" - exit 1 - else - echo "Reference number is $reference_num" - echo "REFERENCE=${reference_num}" >> $GITHUB_ENV - fi shell: bash - - name: Add env tag for workitem - id: tag-workitem run: | - echo "Going to add tag ${{ inputs.deploy_env }} to a work item identified by $REFERENCE number." - shell: bash \ No newline at end of file + git_action_branch=$(echo "$GITHUB_ACTION_PATH" | cut -d'/' -f8) + python /home/runner/work/_actions/LukaszSielski/workflows_tests/scripts/script.py + # - name: Get PR's body for commit identified by ${{ inputs.commit-sha }} SHA + # id: get-pr-body + # env: + # GH_TOKEN: ${{ inputs.gh-token }} + # run: | + # PRBODY=$(gh pr list --json body --repo ${{ inputs.repository }} --state merged --search ${{ inputs.commit-sha }} --jq '.[].body') + # echo "PRs body: $PRBODY" + # echo "PRBODY=${PRBODY}" >> $GITHUB_ENV + # shell: bash + # - name: Extract work item reference number from PR's body + # id: extract-reference-number + # run: | + # reference_num=$(echo $PRBODY | sed -n "s/^.*AB#\([0-9]*\).*$/\1/p") + # if [ -z "$reference_num" ] + # then + # echo "Reference number not found!" + # exit 1 + # else + # echo "Reference number is $reference_num" + # echo "REFERENCE=${reference_num}" >> $GITHUB_ENV + # fi + # shell: bash + # - name: Add env tag for workitem + # id: tag-workitem + # run: | + # echo "Going to add tag ${{ inputs.deploy_env }} to a work item identified by $REFERENCE number." + # shell: bash \ No newline at end of file diff --git a/scripts/script.py b/scripts/script.py new file mode 100644 index 0000000..a982c89 --- /dev/null +++ b/scripts/script.py @@ -0,0 +1,5 @@ +def main(): + print('test') + +if __name__ == '__main__': + main() \ No newline at end of file