Migration from Concourse to Github Actions #8
Workflow file for this run
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: Check PR | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files_ignore: | | |
README.md | |
ci/** | |
- name: auto_pass | |
if: steps.changed-files.outputs.all_modified_files == '0' | |
id: check_if_only_ignored | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
for file in ${ALL_CHANGED_FILES}; do | |
echo "$file was changed" | |
done | |
- name: Get version from file | |
if: steps.changed-files.outputs.all_modified_files != '0' | |
id: get_version | |
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT | |
- name: 'Get Previous tag' | |
if: steps.changed-files.outputs.all_modified_files != '0' | |
id: previoustag | |
uses: "WyriHaximus/[email protected]" | |
- name: Checking for version bump | |
if: steps.changed-files.outputs.all_modified_files != '0' | |
id: check_vbump | |
run: | | |
LAST_TAG="${{ steps.previoustag.outputs.tag }}" | |
NEW_TAG="v${{ steps.get_version.outputs.version }}" | |
RESULT=$(ci/assets/checksemver.sh ${NEW_TAG} ${LAST_TAG}) | |
if [ "${RESULT}" == "1" ]; then | |
echo "msg=Version bump found." >> $GITHUB_OUTPUT | |
exit 0 | |
elif [ "${RESULT}" == "0" ]; then | |
echo "msg=Version bump did not happen. ${LAST_TAG} is the same as ${NEW_TAG}" >> $GITHUB_OUTPUT | |
exit 1 | |
else | |
echo "msg=Version bump did not happen. ${LAST_TAG} is higher than ${NEW_TAG}" >> $GITHUB_OUTPUT | |
exit 1 | |
fi | |
- uses: mshick/[email protected] | |
if: steps.changed-files.outputs.all_modified_files != '0' | |
with: | |
message: | | |
${{ steps.check_vbump.outputs.msg }} |