testing (#6) #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Tag Build | |
on: # yamllint disable-line rule:truthy | |
workflow_dispatch: | |
push: | |
branches: | |
- tagging | |
paths-ignore: | |
- '.github/**' | |
- './catalog-info.yaml' | |
- '**/README.md' | |
jobs: | |
get-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
changed_files: ${{ steps.dir_changes.outputs.all_changed_files }} | |
steps: | |
- name: Github Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Directory changes | |
uses: tj-actions/changed-files@v44 | |
id: dir_changes | |
with: | |
dir_names: true | |
dir_names_include_files: false | |
dir_names_max_depth: 3 | |
matrix: true | |
files_ignore: | | |
.github/** | |
update-tags: | |
name: Tag update for ${{ matrix.changed-folder }} | |
strategy: | |
fail-fast: false | |
matrix: | |
changed-folder: ${{ fromJSON(needs.get-changes.outputs.changed_files) }} | |
runs-on: ubuntu-latest | |
needs: | |
- get-changes | |
permissions: | |
contents: write | |
steps: | |
- name: Github Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Show module - ${{ matrix.changed-folder }} | |
run: | | |
echo "Tag folder ${{ matrix.changed-folder }} " >> ${GITHUB_STEP_SUMMARY} | |
- name: Generate tag name | |
id: tag-name | |
env: | |
FOLDER: ${{ matrix.changed-folder }} | |
run: | | |
for path in ${FOLDER}; do | |
IFS='/' read -ra parts <<< "$path" | |
if [ "${#parts[@]}" -ge 3 ]; then | |
first=${parts[0]} | |
second="${parts[1]}" | |
echo "tag-name=${first}-${second}-v" >> ${GITHUB_OUTPUT} | |
fi | |
done | |
- name: Show tag - ${{ steps.tag-name.outputs.tag-name }} | |
run: | | |
echo "Tag to create ${{ steps.tag-name.outputs.tag-name }} " >> ${GITHUB_STEP_SUMMARY} | |
- name: Bump version and push tag | |
uses: timothyclarke/github-tag-action@d80b21f44ba5b62ed4b9bb35c7032289e1fc10bf | |
# uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token | |
DEFAULT_BRANCH: tagging | |
RELEASE_BRANCHES: tagging | |
TAG_PREFIX: ${{ steps.tag-name.outputs.tag-name }} | |
PRERELEASE: false | |
VERBOSE: true |