Skip to content

Commit 5a1fd3d

Browse files
Merge pull request #2 from Facets-cloud/git-ref
Send git ref and git web url to control plane
2 parents 21a912d + 210d67b commit 5a1fd3d

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

module-preview-action/action.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ runs:
6262
echo "📦 Final list of Facets modules: $FACETS_DIRS"
6363
echo "dirs=$FACETS_DIRS" >> "$GITHUB_ENV"
6464
echo "✅ Dry run mode complete."
65-
65+
6666
6767
- name: Identify Changed Directories (Changed Modules)
6868
if: inputs.all-modules != 'true'
@@ -100,8 +100,8 @@ runs:
100100
echo "📦 Final list of changed Facets modules: $FACETS_DIRS"
101101
echo "dirs=$FACETS_DIRS" >> "$GITHUB_ENV"
102102
echo "✅ Step complete."
103-
104-
103+
104+
105105
106106
- name: Run Terraform Formatting Check (Fail on Incorrect Formatting)
107107
if: env.dirs != ''
@@ -131,6 +131,23 @@ runs:
131131
checkov -d "$dir" --quiet --hard-fail-on HIGH,CRITICAL --framework terraform,kubernetes --output cli
132132
done
133133
134+
- name: Get Git Info
135+
if: env.dirs != '' && inputs.dry-run != 'true'
136+
id: git_info
137+
shell: bash
138+
run: |
139+
# Get commit ID
140+
COMMIT_ID=$(git rev-parse HEAD)
141+
echo "commit_id=$COMMIT_ID" >> $GITHUB_ENV
142+
143+
# Construct Git URL
144+
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
145+
GIT_URL="${REPO_URL}/commit/${COMMIT_ID}"
146+
echo "git_url=$GIT_URL" >> $GITHUB_ENV
147+
148+
echo "🔍 Git Commit ID: $COMMIT_ID"
149+
echo "🔍 Git URL: $GIT_URL"
150+
134151
- name: Preview Facets Module
135152
if: env.dirs != '' && inputs.dry-run != 'true'
136153
shell: bash
@@ -142,6 +159,8 @@ runs:
142159
-c "${{ inputs.control_plane_url }}" \
143160
-u "${{ inputs.username }}" \
144161
-t "${{ inputs.token }}" \
145-
-p "$dir" -a
162+
-p "$dir" -a \
163+
-g "${{ env.git_url }}" \
164+
-r "${{ env.commit_id }}"
146165
fi
147166
done

0 commit comments

Comments
 (0)