Skip to content

Commit 1dff7fe

Browse files
anujhydrabadiclaude
andcommitted
Version the actions: semver tags + v1 alias, deprecate ftf action, bump managed actions
- Add release.yml: pushing a vX.Y.Z tag moves the major alias tag (v1) and creates the GitHub release; consumers pin module-ci-action@v1 instead of @master. - Document the versioning convention in the root and module-ci-action READMEs; example workflows now reference @v1. - Mark the ftf-based module-preview-action as deprecated (root README + its own README); module-ci-action is the current action. - Bump managed actions: actions/checkout v4 -> v7 (action steps, test workflows, README examples), actions/setup-python v5 -> v6. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 9396032 commit 1dff7fe

8 files changed

Lines changed: 104 additions & 24 deletions

File tree

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Release"
2+
3+
# Versioning for the actions in this repo (they are consumed as
4+
# Facets-cloud/github-actions/<action>@<ref>):
5+
#
6+
# - Exact releases are annotated semver tags: v1.0.0, v1.1.0, ...
7+
# - Each major has a MOVING alias tag (v1, v2, ...) that always points at the
8+
# latest release of that major — the same convention as actions/checkout.
9+
# Consumers (including the workflow the control plane bootstraps into
10+
# customer repos) pin the alias: module-ci-action@v1.
11+
#
12+
# Pushing a semver tag runs this workflow, which force-moves the major alias
13+
# to the new tag and creates a GitHub release for it. To cut a release:
14+
#
15+
# git tag v1.2.0 && git push origin v1.2.0
16+
on:
17+
push:
18+
tags:
19+
- "v[0-9]+.[0-9]+.[0-9]+"
20+
21+
permissions:
22+
contents: write
23+
24+
jobs:
25+
release:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v7
30+
31+
- name: Move the major alias tag
32+
run: |
33+
set -euo pipefail
34+
TAG="${GITHUB_REF_NAME}"
35+
MAJOR="${TAG%%.*}" # v1.2.3 -> v1
36+
echo "Pointing ${MAJOR} at ${TAG}"
37+
git config user.name "github-actions[bot]"
38+
git config user.email "github-actions[bot]@users.noreply.github.com"
39+
git tag -f -a "${MAJOR}" -m "Point ${MAJOR} at ${TAG}" "${TAG}^{}"
40+
git push origin "${MAJOR}" --force
41+
42+
- name: Create GitHub release
43+
env:
44+
GH_TOKEN: ${{ github.token }}
45+
run: |
46+
set -euo pipefail
47+
TAG="${GITHUB_REF_NAME}"
48+
if gh release view "${TAG}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
49+
echo "Release ${TAG} already exists; skipping."
50+
else
51+
gh release create "${TAG}" --repo "${GITHUB_REPOSITORY}" \
52+
--title "${TAG}" --generate-notes
53+
fi

.github/workflows/test-module-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout Repository
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v7
2424

2525
- name: Install shellcheck
2626
run: sudo apt-get update && sudo apt-get install -y shellcheck

.github/workflows/test-module-preview.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout Repository
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v7
2020

2121
- name: Run Facets Module Preview Action (Local)
2222
uses: ./module-preview-action # Run from local repo

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
# Facets GitHub Actions
22

3+
Actions in this repo are consumed as `Facets-cloud/github-actions/<action>@<version>`.
4+
Releases are semver tags with a moving major alias (`v1` always points at the latest
5+
`v1.x.y`) — pin the major alias unless you need an exact version.
36

4-
## 1. Facets Module Preview & Security Scan
5-
6-
The **Facets Module Preview & Security Scan** GitHub Action automates validation and security checks for Facets
7-
Terraform modules. It performs the following tasks:
8-
9-
[module-preview-action README](./module-preview-action/README.md).
10-
11-
- **Terraform Formatting Checks**: Ensures Terraform files are formatted correctly.
12-
- **Terraform Validation**: Verifies the correctness of Terraform configurations.
13-
- **Checkov Security Scanning**: Identifies security vulnerabilities in Terraform code.
14-
- **Facets Module Preview**: Registers a Preview only module with your Facets Control Plane.
15-
16-
## 2. Facets Module CI
7+
## 1. Facets Module CI (current)
178

189
The **Facets Module CI** GitHub Action provides end-to-end CI for a Facets **modules
1910
repository** (`modules/{intent}/{flavor}/{version}`) using the **`raptor`** CLI. It runs
@@ -28,6 +19,23 @@ in three modes, derived automatically from the triggering event:
2819
- **Cleanup (on pull request close)**: Deletes each changed module's preview, but only
2920
the previews this PR's own commits created (ownership-checked).
3021

31-
This action is a sibling of the `ftf`-based `module-preview-action` above and does not
32-
replace it — choose the one matching your CLI.
22+
This is the action the Facets control plane wires into bootstrapped modules
23+
repositories, and the recommended CI for all modules repos.
3324

25+
## 2. Facets Module Preview & Security Scan (deprecated)
26+
27+
> ⚠️ **Deprecated.** This action is based on the legacy `ftf` CLI and is kept only for
28+
> existing workflows that still use it. It receives no new features. New repos should
29+
> use [**module-ci-action**](./module-ci-action/README.md) above; to migrate, replace
30+
> the `module-preview-action` step with `module-ci-action` (raptor-based inputs — see
31+
> its README) and adopt the `modules/{intent}/{flavor}/{version}` layout.
32+
33+
The **Facets Module Preview & Security Scan** GitHub Action automates validation and
34+
security checks for Facets Terraform modules:
35+
36+
[module-preview-action README](./module-preview-action/README.md).
37+
38+
- **Terraform Formatting Checks**: Ensures Terraform files are formatted correctly.
39+
- **Terraform Validation**: Verifies the correctness of Terraform configurations.
40+
- **Checkov Security Scanning**: Identifies security vulnerabilities in Terraform code.
41+
- **Facets Module Preview**: Registers a Preview only module with your Facets Control Plane.

module-ci-action/README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ triggering event:
1414
| `pull_request` **closed without merge** | **cleanup** | Deletes the preview each changed module owns — **only if** the preview belongs to a commit from this PR. |
1515
| `pull_request` **closed by merge** | **no-op** | Skipped: the concurrent `push` (publish) run re-uploads and publishes the module at the merge commit, so it owns the slot. Running cleanup here would be redundant and could race the publish. |
1616

17-
> This action is a sibling of [`module-preview-action`](../module-preview-action)
18-
> (the `ftf`-based action). They are independent — pick the one that matches your CLI.
17+
> This action supersedes the **deprecated** `ftf`-based
18+
> [`module-preview-action`](../module-preview-action), which is kept only for
19+
> existing workflows.
1920
2021
## Modules-repo layout
2122

@@ -117,7 +118,7 @@ jobs:
117118
runs-on: ubuntu-latest
118119
steps:
119120
- name: Facets Module CI
120-
uses: Facets-cloud/github-actions/module-ci-action@master
121+
uses: Facets-cloud/github-actions/module-ci-action@v1
121122
with:
122123
control_plane_url: ${{ secrets.CONTROL_PLANE_URL }}
123124
username: ${{ secrets.FACETS_USERNAME }}
@@ -130,6 +131,19 @@ jobs:
130131
If you prefer separate workflow files, split the three triggers apart and let `mode`
131132
stay `auto`; the action derives `preview` / `publish` / `cleanup` from each event.
132133

134+
## Versioning
135+
136+
Reference this action by version, not by branch:
137+
138+
- **`@v1`** — the moving major alias; always points at the latest `v1.x.y` release.
139+
This is what the control plane's bootstrapped workflow uses and the right default.
140+
- **`@v1.2.3`** — an exact release, if you need to pin harder.
141+
142+
Releases are cut by pushing a semver tag (`git tag v1.2.0 && git push origin v1.2.0`);
143+
the repo's `release.yml` workflow then moves the major alias and publishes the GitHub
144+
release. Breaking changes to the action's inputs or behavior get a new major
145+
(`v2`, with a `v2` alias) — the `v1` alias never picks them up.
146+
133147
## Single-preview-slot semantics
134148

135149
Each module (`intent/flavor/version`) has exactly **one preview slot** on the Control

module-ci-action/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
using: "composite"
5050
steps:
5151
- name: Checkout repository
52-
uses: actions/checkout@v4
52+
uses: actions/checkout@v7
5353
with:
5454
fetch-depth: 0
5555

module-preview-action/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Facets Preview & Security Scan GitHub Action
22

3+
> ⚠️ **Deprecated.** This action is based on the legacy `ftf` CLI and is kept only for
4+
> existing workflows. It receives no new features. Use
5+
> [**module-ci-action**](../module-ci-action/README.md) instead — the `raptor`-based
6+
> action the Facets control plane wires into bootstrapped modules repositories.
7+
38
This GitHub Action performs:
49

510
✅ Terraform formatting checks
@@ -43,7 +48,7 @@ jobs:
4348

4449
steps:
4550
- name: Checkout Repository
46-
uses: actions/checkout@v4
51+
uses: actions/checkout@v7
4752

4853
- name: Run Facets Preview & Security Scan
4954
uses: Facets-cloud/github-actions/module-preview-action@master

module-preview-action/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ runs:
4545
using: "composite"
4646
steps:
4747
- name: Checkout Repository
48-
uses: actions/checkout@v4
48+
uses: actions/checkout@v7
4949
with:
5050
fetch-depth: 0
5151

@@ -55,7 +55,7 @@ runs:
5555
run: |
5656
touch ./requirements.txt
5757
58-
- uses: actions/setup-python@v5
58+
- uses: actions/setup-python@v6
5959
with:
6060
python-version: "3.12"
6161
cache: "pip"

0 commit comments

Comments
 (0)