Skip to content

chore(deps): bump actions/checkout from 4.1.0 to 4.2.1 #54

chore(deps): bump actions/checkout from 4.1.0 to 4.2.1

chore(deps): bump actions/checkout from 4.1.0 to 4.2.1 #54

name: Build Artifacts for PRs
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
generate-tag:
name: Generate docker tag
runs-on: ubuntu-latest
outputs:
image_tag: ${{steps.gen_tag_names.outputs.tag_name}}
steps:
- name: Checkout
uses: actions/checkout@v4.2.1
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
- name: Validate Branch Name
id: validate_branch_name
run: |
# Perform input validation here
# For example, check for forbidden characters
if [[ "${{ github.head_ref }}" =~ [^a-zA-Z0-9._-/] ]]; then
echo "Error: Branch name contains invalid characters."
exit 1
fi
# Replace problematic characters in branch name (like '/') with safe characters (like '.')
- name: Generate Tag Names
id: gen_tag_names
run: |
tag_name=$(echo ${{ github.head_ref }} | tr "/" .)
echo "Tag Name: $tag_name"
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
build:
name: Build Shopify Tracker Docker Image
uses: ./.github/workflows/build-and-push-docker-image.yml
needs: [generate-tag]
with:
img_tag: ${{ needs.generate-tag.outputs.image_tag }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}