Skip to content

Commit

Permalink
Fix permissions errors on ECS generation GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Dec 13, 2024
1 parent c1ca5e9 commit 1bb7b19
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/generate-ecs-mappings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -22,8 +24,11 @@ jobs:
- name: Extract ECS Module and Run ECS Generator
id: run-ecs-generator
run: |
# Fetch base branch
git fetch origin +refs/heads/master:refs/remotes/origin/master
# Extract the ECS module name from the modified files
modified_files=$(git diff --name-only HEAD^ HEAD)
modified_files=$(git diff --name-only origin/master)
ecs_module=""
for file in $modified_files; do
if [[ $file == ecs/* ]]; then
Expand All @@ -34,7 +39,7 @@ jobs:
if [[ -n "$ecs_module" ]]; then
# Run the ECS generator script
docker/ecs/mapping-generator.sh run "$ecs_module"
bash docker/ecs/mapping-generator.sh run "$ecs_module"
echo "ecs_module=$ecs_module" >> $GITHUB_ENV
else
echo "No modifications detected in ecs/ directory."
Expand All @@ -43,7 +48,7 @@ jobs:
- name: Tear down ECS Generator
if: always()
run: docker/ecs/mapping-generator.sh down
run: bash docker/ecs/mapping-generator.sh down

- name: Upload artifact
if: always()
Expand Down

0 comments on commit 1bb7b19

Please sign in to comment.