testing tj actions to store directory changes in env var #9
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: Track changes between main and new commit | ||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- 'ci-specific-modules' | ||
jobs: | ||
changed_files: | ||
# ------------------------------------------------------------------------ | ||
# Event `pull_request`: Compare the last commit of the main branch or last | ||
# remote commit of the PR branch -> to the current commit of a PR branch. | ||
# ------------------------------------------------------------------------ | ||
runs-on: ubuntu-latest # windows-latest || macos-latest | ||
name: Test changed-files | ||
env: | ||
CHANGED_MODULES: "" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | ||
- name: Get changed files inside action folder | ||
id: changed-files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: .src/action/** | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
env: | ||
CHANGED_MODULES: action | ||
- name: Get changed files inside interfacing folder | ||
id: changed-files | ||
Check failure on line 34 in .github/workflows/temp_ci_test.yml GitHub Actions / Track changes between main and new commitInvalid workflow file
|
||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: .src/interfacing/** | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
env: | ||
CHANGED_MODULES: "$CHANGED_MODULES interfacing" | ||
- name: List all changed files | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
for file in ${ALL_CHANGED_FILES}; do | ||
echo "$file was changed!" | ||
done | ||
echo ======================= | ||
echo "CHANGED_MODULES: $CHANGED_MODULES" | ||
# setup-environment: | ||
# name: Setup environment | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# registry: ${{ steps.docker-environment.outputs.registry }} | ||
# repository: ${{ steps.docker-environment.outputs.repository }} | ||
# steps: | ||
# - name: Checkout Repository | ||
# uses: actions/checkout@v3 | ||
# - name: Setup Watod Environment | ||
# run: ./watod_scripts/watod-setup-env.sh | ||
# shell: bash | ||
# - name: Generate Docker Environment | ||
# id: docker-environment | ||
# uses: "./.github/templates/docker_context" |