Skip to content

Filter out the last merge commit from results for next version search… #181

Filter out the last merge commit from results for next version search…

Filter out the last merge commit from results for next version search… #181

Workflow file for this run

name: Auto tag new actions
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
find_changes:
name: "Find changed directories that need tagging"
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
matrix_empty: ${{ steps.get-matrix.outputs.matrix_empty }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: get-matrix
uses: smartlyio/find-changes-action@v2
with:
directory_containing: action.yml
create_tag:
name: "Create tags"
runs-on: ubuntu-22.04
needs: find_changes
if: needs.find_changes.outputs.matrix_empty == 'false'
strategy:
fail-fast: false
matrix:
directory: ${{ fromJson(needs.find_changes.outputs.matrix).directory }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for invalid names
shell: bash
run: |
if git rev-parse --verify "$DIRECTORY"; then
echo "The folder name cannot be the one of an existing ref"
exit 1
fi
if [ $(git tag -l "$DIRECTORY") ]; then
echo "The folder name cannot be the one of an existing tag"
exit 1
fi
env:
DIRECTORY: '${{ matrix.directory }}'
- name: Configure git
uses: "smartlyio/github-actions@git-init-userinfo-v1"
- uses: "smartlyio/github-actions@action-monorepo-promote-v1"
with:
action_name: "${{ matrix.directory }}"
- uses: "smartlyio/github-actions@auto-tagger-v1"
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_prefix: "${{ matrix.directory }}-"
force_push: "true"
commit_latest: "Promoted action ${{ matrix.directory }}"
auto_tag_always: ${{ github.event_name == 'push' }}