Skip to content

Commit 7a91dca

Browse files
authored
Initial commit
0 parents  commit 7a91dca

24 files changed

Lines changed: 842 additions & 0 deletions

.checkov.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
quiet: true
2+
skip-check:
3+
- CKV_DOCKER_2
4+
- CKV_DOCKER_3

.devcontainer/devcontainer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "GitHub Actions (Container)",
3+
"image": "mcr.microsoft.com/devcontainers/base",
4+
"customizations": {
5+
"codespaces": {
6+
"openFiles": ["README.md"]
7+
},
8+
"vscode": {
9+
"extensions": [
10+
"bierner.markdown-preview-github-styles",
11+
"davidanson.vscode-markdownlint",
12+
"esbenp.prettier-vscode",
13+
"github.copilot",
14+
"github.copilot-chat",
15+
"github.vscode-github-actions",
16+
"github.vscode-pull-request-github",
17+
"me-dutour-mathieu.vscode-github-actions",
18+
"ms-azuretools.vscode-docker",
19+
"redhat.vscode-yaml",
20+
"yzhang.markdown-all-in-one"
21+
],
22+
"settings": {
23+
"editor.defaultFormatter": "esbenp.prettier-vscode",
24+
"editor.tabSize": 2,
25+
"editor.formatOnSave": true,
26+
"markdown.extension.list.indentationSize": "adaptive",
27+
"markdown.extension.italic.indicator": "_",
28+
"markdown.extension.orderedList.marker": "one"
29+
}
30+
}
31+
},
32+
"remoteEnv": {
33+
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
34+
},
35+
"features": {
36+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
37+
"ghcr.io/devcontainers/features/github-cli:1": {},
38+
"ghcr.io/devcontainers-community/npm-features/prettier:1": {}
39+
}
40+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/copilot-instructions.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copilot Instructions
2+
3+
This GitHub Action is written as a Docker container that invokes an entrypoint
4+
script. The entrypoint script is responsible for invoking the main logic of the
5+
action.
6+
7+
## Repository Structure
8+
9+
| Path | Description |
10+
| -------------------- | ----------------------------------- |
11+
| `.devcontainer/` | Development Container Configuration |
12+
| `.github/` | GitHub Configuration |
13+
| `.markdown-lint.yml` | Markdown Linter Configuration |
14+
| `.prettierrc.yml` | Prettier Formatter Configuration |
15+
| `.yaml-lint.yml` | YAML Linter Configuration |
16+
| `action.yml` | GitHub Action Metadata |
17+
| `CODEOWNERS` | Code Owners File |
18+
| `Dockerfile` | Dockerfile for the Action |
19+
| `entrypoint.sh` | Entrypoint Script |
20+
| `LICENSE` | License File |
21+
| `README.md` | Project Documentation |
22+
23+
## General Coding Guidelines
24+
25+
- Follow standard shell scripting conventions and best practices
26+
- Changes should maintain consistency with existing patterns and style
27+
- Document changes clearly and thoroughly, including updates to existing
28+
comments when appropriate
29+
- Do not include basic, unnecessary comments that simply restate what the code
30+
is doing (focus on explaining _why_, not _what_)
31+
- Use consistent error handling patterns throughout the codebase
32+
- Keep functions focused and manageable
33+
- Use descriptive variable and function names that clearly convey their purpose
34+
- When suggesting code changes, always opt for the most maintainable approach.
35+
Try your best to keep the code clean and follow "Don't Repeat Yourself" (DRY)
36+
principles
37+
- Avoid unnecessary complexity and always consider the long-term maintainability
38+
of the code
39+
40+
### Versioning
41+
42+
GitHub Actions are versioned using branch and tag names. The version should
43+
follow [Semantic Versioning](https://semver.org/) principles.
44+
45+
## Pull Request Guidelines
46+
47+
When creating a pull request (PR), please ensure that:
48+
49+
- Keep changes focused and minimal (avoid large changes, or consider breaking
50+
them into separate, smaller PRs)
51+
- Formatting checks pass
52+
- Linting checks pass
53+
- If necessary, the `README.md` file is updated to reflect any changes in
54+
functionality or usage
55+
56+
The body of the PR should include:
57+
58+
- A summary of the changes
59+
- A special note of any changes to dependencies
60+
- A link to any relevant issues or discussions
61+
- Any additional context that may be helpful for reviewers
62+
63+
## Code Review Guidelines
64+
65+
When performing a code review, please follow these guidelines:
66+
67+
- If there are changes that modify the functionality/usage of the action,
68+
validate that there are changes in the `README.md` file that document the new
69+
or modified functionality

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: docker
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
docker-minor:
9+
update-types:
10+
- minor
11+
- patch
12+
13+
- package-ecosystem: github-actions
14+
directory: /
15+
schedule:
16+
interval: weekly
17+
groups:
18+
actions-minor:
19+
update-types:
20+
- minor
21+
- patch

.github/linters/.checkov.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
quiet: true
2+
skip-check:
3+
# Ensure that HEALTHCHECK instructions have been added to container images
4+
- CKV_DOCKER_2
5+
# Ensure that a user for the container has been created
6+
- CKV_DOCKER_3

.github/linters/.markdown-lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Unordered list style
2+
MD004:
3+
style: dash
4+
5+
# Ordered list item prefix
6+
MD029:
7+
style: one
8+
9+
# Spaces after list markers
10+
MD030:
11+
ul_single: 1
12+
ol_single: 1
13+
ul_multi: 1
14+
ol_multi: 1
15+
16+
# Code block style
17+
MD046:
18+
style: fenced

.github/linters/.yaml-lint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rules:
2+
document-end: disable
3+
document-start:
4+
level: warning
5+
present: false
6+
line-length:
7+
level: warning
8+
max: 80
9+
allow-non-breakable-words: true
10+
allow-non-breakable-inline-mappings: true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Create Release Notes
2+
3+
You are an expert technical writer tasked with creating release notes for
4+
updates to this repository. Your specific task is to generate release notes that
5+
are clear, concise, and useful for developers and users of the project.
6+
7+
## Guidelines
8+
9+
Ensure you adhere to the following guidelines when creating release notes:
10+
11+
- Use a clear and consistent format for the release notes
12+
- Include a summary of the changes made in the release
13+
- Highlight any new features, improvements, or bugfixes
14+
- If applicable, include instructions for upgrading or migrating to the new
15+
version
16+
- Use technical language that is appropriate for the audience, but avoid jargon
17+
that may not be understood by all users
18+
- Ensure that the release notes are easy to read and navigate
19+
- Include relevant issue or PR numbers where applicable
20+
- Use proper Markdown formatting
21+
- Use code blocks for commands, configuration examples, or code changes
22+
- Use note and warning callouts for important information
23+
24+
## Versioning
25+
26+
GitHub Actions are versioned using branch and tag names. The version in the
27+
project's `package.json` should reflect the changes made in the codebase and
28+
follow [Semantic Versioning](https://semver.org/) principles. Depending on the
29+
nature of the changes, please make sure to adjust the release notes accordingly:
30+
31+
- For **major** changes, include a detailed description of the breaking changes
32+
and how users can adapt to them
33+
- For **minor** changes, highlight new features and improvements
34+
- For **patch** changes, focus on bugfixes and minor improvements

.github/workflows/cd.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# When a PR is merged, or when run manually, this workflow will create a
2+
# release and publish the container image to the GitHub Container Registry. Both
3+
# will be labeled with the version specified in the manifest file.
4+
name: Continuous Delivery
5+
6+
on:
7+
pull_request:
8+
types:
9+
- closed
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
env:
15+
CONTAINER_REGISTRY: ghcr.io
16+
CONTAINER_REGISTRY_USERNAME: ${{ github.actor }}
17+
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
18+
MANIFEST_PATH: action.yml
19+
20+
permissions:
21+
contents: write
22+
packages: write
23+
24+
jobs:
25+
publish:
26+
name: Publish Container Image
27+
runs-on: ubuntu-latest
28+
29+
# Ignore Dependabot pull requests.
30+
if: |
31+
github.event_name == 'workflow_dispatch' ||
32+
(github.event.pull_request.merged == true &&
33+
startsWith(github.head_ref, 'dependabot/') == false)
34+
35+
steps:
36+
- name: Checkout
37+
id: checkout
38+
uses: actions/checkout@v6
39+
with:
40+
fetch-tags: true
41+
ref: main
42+
43+
- name: Check Version
44+
id: version
45+
uses: issue-ops/semver@v3
46+
with:
47+
check-only: true
48+
manifest-path: ${{ env.MANIFEST_PATH }}
49+
ref: main
50+
workspace: ${{ github.workspace }}
51+
52+
# Create the list of image tags that will be published. If a prerelease is
53+
# being published (e.g. `1.2.3-alpha.4`), only the prerelease tag will be
54+
# published (`v1.2.3-alpha.4`). Otherwise, the following tags will be
55+
# published:
56+
# - `latest`
57+
# - `v1.2.3`
58+
# - `v1.2`
59+
# - `v1`
60+
- name: Set Image Tags
61+
id: tags
62+
uses: actions/github-script@v8
63+
with:
64+
script: |
65+
const version = '${{ steps.version.outputs.version }}'
66+
67+
// Check if prerelease (e.g. 1.2.3-alpha.4)
68+
if (version.includes('-')) {
69+
// Only output the prerelease tag
70+
core.setOutput('tags', `type=raw,value=v${version}`)
71+
} else {
72+
// Output all the tags
73+
let tags = [
74+
'type=raw,value=latest',
75+
`type=raw,value=v${version}`,
76+
`type=raw,value=v${version.split('.').slice(0, 2).join('.')}`,
77+
`type=raw,value=v${version.split('.')[0]}`
78+
]
79+
core.setOutput('tags', tags.join('\n'))
80+
}
81+
82+
# Get metadata to apply to image
83+
- name: Extract Metadata
84+
id: meta
85+
uses: docker/metadata-action@v5
86+
with:
87+
images: ${{ env.CONTAINER_REGISTRY }}/${{ github.repository }}
88+
tags: ${{ steps.tags.outputs.tags }}
89+
90+
# Authenticate to the container registry
91+
- name: Authenticate to Container Registry
92+
id: login
93+
uses: docker/login-action@v3
94+
with:
95+
registry: ${{ env.CONTAINER_REGISTRY }}
96+
username: ${{ env.CONTAINER_REGISTRY_USERNAME }}
97+
password: ${{ env.CONTAINER_REGISTRY_PASSWORD }}
98+
99+
# Publish the container image
100+
- name: Publish Container Image
101+
id: publish
102+
uses: docker/build-push-action@v6
103+
env:
104+
LABELS: ${{ steps.meta.outputs.labels }}
105+
TAGS: ${{ steps.meta.outputs.tags }}
106+
with:
107+
labels: ${{ env.LABELS }}
108+
push: true
109+
tags: ${{ env.TAGS }}
110+
111+
- name: Create Release
112+
id: release
113+
uses: issue-ops/releaser@v3
114+
with:
115+
tag: v${{ steps.version.outputs.version }}

0 commit comments

Comments
 (0)