Skip to content

Commit

Permalink
change to python
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasSielski committed Sep 12, 2024
1 parent 65953d1 commit b1251cb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 24 deletions.
54 changes: 30 additions & 24 deletions .github/workflows/actions/ado_tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
5 changes: 5 additions & 0 deletions scripts/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def main():
print('test')

if __name__ == '__main__':
main()

0 comments on commit b1251cb

Please sign in to comment.