Skip to content

Mark Jira tickets as Production v2 #234

Mark Jira tickets as Production v2

Mark Jira tickets as Production v2 #234

name: Mark Jira tickets as Production v2
on:
create:
ref_type: "tag"
# workflow_dispatch:
jobs:
job1:
name: (Job) Mark Jira tickets as Production v2
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- name: checkout source code
# for some reason, only v1 works. v2 will return an empty value for the git branch command below!
uses: actions/checkout@v1
- name: Filter non-master branches
run: |
raw=$(git branch -r --contains ${{ github.ref }})
echo ${raw}
branch=${raw/origin\/}
echo ${branch}
if [ -z ${branch} ]; then
echo "no value in branch var, have you switched to actions/checkout v2?"
exit 1
fi
if [ ${branch} != "master" ] && [ ${branch} != "main" ] ; then
echo "tagged a branch, not master, exiting"
exit 1
fi
echo "is master or main, continuing"
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Setup requests package (is this redundant?)
uses: BSFishy/pip-action@v1
with:
packages: |
requests
- name: Run our script
run: python ./.github/scripts/prod-tag.py
env:
JIRA_API_TOKEN: ${{ secrets.JIRA_SECRET }}