Skip to content

Commit 699abe2

Browse files
authored
Merge pull request #91 from cisagov/lineage/skeleton
⚠️ CONFLICT! Lineage pull request for: skeleton
2 parents 4f8c1f9 + e117a62 commit 699abe2

37 files changed

+1939
-683
lines changed

.github/CODEOWNERS

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@
33
# These owners will be the default owners for everything in the
44
# repo. Unless a later match takes precedence, these owners will be
55
# requested for review when someone opens a pull request.
6-
* @dav3r @jasonodoom @jsf9k @mcdonnnj
6+
* @dav3r @jsf9k @mcdonnnj
77

88
# These folks own any files in the .github directory at the root of
99
# the repository and any of its subdirectories.
10-
/.github/ @dav3r @felddy @jasonodoom @jsf9k @mcdonnnj
10+
/.github/ @dav3r @felddy @jsf9k @mcdonnnj
11+
12+
# These folks own all linting configuration files.
13+
/.ansible-lint @dav3r @felddy @jsf9k @mcdonnnj
14+
/.bandit.yml @dav3r @felddy @jsf9k @mcdonnnj
15+
/.flake8 @dav3r @felddy @jsf9k @mcdonnnj
16+
/.isort.cfg @dav3r @felddy @jsf9k @mcdonnnj
17+
/.mdl_config.yaml @dav3r @felddy @jsf9k @mcdonnnj
18+
/.pre-commit-config.yaml @dav3r @felddy @jsf9k @mcdonnnj
19+
/.prettierignore @dav3r @felddy @jsf9k @mcdonnnj
20+
/.yamllint @dav3r @felddy @jsf9k @mcdonnnj
21+
/requirements.txt @dav3r @felddy @jsf9k @mcdonnnj
22+
/requirements-dev.txt @dav3r @felddy @jsf9k @mcdonnnj
23+
/requirements-test.txt @dav3r @felddy @jsf9k @mcdonnnj
24+
/setup-env @dav3r @felddy @jsf9k @mcdonnnj

.github/dependabot.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,43 @@ updates:
1111
schedule:
1212
interval: weekly
1313

14+
- directory: /
15+
package-ecosystem: docker-compose
16+
schedule:
17+
interval: weekly
18+
1419
- directory: /
1520
ignore:
1621
# Managed by cisagov/skeleton-generic
1722
- dependency-name: actions/cache
1823
- dependency-name: actions/checkout
24+
- dependency-name: actions/dependency-review-action
25+
- dependency-name: actions/labeler
1926
- dependency-name: actions/setup-go
2027
- dependency-name: actions/setup-python
21-
- dependency-name: crazy-max/ghaction-dump-context
28+
- dependency-name: cisagov/action-job-preamble
29+
- dependency-name: cisagov/setup-env-github-action
2230
- dependency-name: crazy-max/ghaction-github-labeler
23-
- dependency-name: crazy-max/ghaction-github-status
31+
- dependency-name: github/codeql-action
32+
- dependency-name: hashicorp/setup-packer
2433
- dependency-name: hashicorp/setup-terraform
2534
- dependency-name: mxschmitt/action-tmate
26-
- dependency-name: step-security/harden-runner
2735
# Managed by cisagov/skeleton-docker
2836
- dependency-name: actions/download-artifact
29-
- dependency-name: actions/github-script
3037
- dependency-name: actions/upload-artifact
38+
- dependency-name: aquasecurity/trivy-action
3139
- dependency-name: docker/build-push-action
3240
- dependency-name: docker/login-action
41+
- dependency-name: docker/metadata-action
3342
- dependency-name: docker/setup-buildx-action
3443
- dependency-name: docker/setup-qemu-action
35-
- dependency-name: github/codeql-action
44+
- dependency-name: peter-evans/dockerhub-description
45+
labels:
46+
# dependabot default we need to replicate
47+
- dependencies
48+
# This matches our label definition in .github/labels.yml as opposed to
49+
# dependabot's default of `github_actions`.
50+
- github-actions
3651
package-ecosystem: github-actions
3752
schedule:
3853
interval: weekly

.github/labeler.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
# Each entry in this file is a label that will be applied to pull requests
3+
# if there is a match based on the matching rules for the entry. Please see
4+
# the actions/labeler documentation for more information:
5+
# https://github.com/actions/labeler#match-object
6+
#
7+
# Note: Verify that the label you want to use is defined in the
8+
# crazy-max/ghaction-github-labeler configuration file located at
9+
# .github/labels.yml.
10+
11+
ansible:
12+
- changed-files:
13+
- any-glob-to-any-file:
14+
- "**/ansible/**"
15+
dependencies:
16+
- changed-files:
17+
- any-glob-to-any-file:
18+
# Add any dependency files used.
19+
- .pre-commit-config.yaml
20+
- requirements*.txt
21+
docker:
22+
- changed-files:
23+
- any-glob-to-any-file:
24+
- "**/compose*.yml"
25+
- "**/docker-compose*.yml"
26+
- "**/Dockerfile*"
27+
documentation:
28+
- changed-files:
29+
- any-glob-to-any-file:
30+
- "**/*.md"
31+
github-actions:
32+
- changed-files:
33+
- any-glob-to-any-file:
34+
- .github/workflows/**
35+
javascript:
36+
- changed-files:
37+
- any-glob-to-any-file:
38+
- "**/*.js"
39+
packer:
40+
- changed-files:
41+
- any-glob-to-any-file:
42+
- "**/*.pkr.hcl"
43+
python:
44+
- changed-files:
45+
- any-glob-to-any-file:
46+
- "**/*.py"
47+
terraform:
48+
- changed-files:
49+
- any-glob-to-any-file:
50+
- "**/*.tf"
51+
test:
52+
- changed-files:
53+
- any-glob-to-any-file:
54+
# Add any test-related files or paths.
55+
- .ansible-lint
56+
- .bandit.yml
57+
- .flake8
58+
- .isort.cfg
59+
- .mdl_config.yaml
60+
- .yamllint
61+
- compose.yml
62+
- pytest.ini
63+
- tests/**
64+
typescript:
65+
- changed-files:
66+
- any-glob-to-any-file:
67+
- "**/*.ts"
68+
upstream update:
69+
- head-branch:
70+
# Any Lineage pull requests should use this branch.
71+
- lineage/skeleton
72+
version bump:
73+
- changed-files:
74+
- any-glob-to-any-file:
75+
# Ensure this matches your version tracking file(s).
76+
- src/version.txt

.github/labels.yml

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,90 @@
22
# Rather than breaking up descriptions into multiline strings we disable that
33
# specific rule in yamllint for this file.
44
# yamllint disable rule:line-length
5-
- color: "eb6420"
5+
- color: f15a53
6+
description: Pull requests that update Ansible code
7+
name: ansible
8+
- color: eb6420
69
description: This issue or pull request is awaiting the outcome of another issue or pull request
710
name: blocked
811
- color: "000000"
912
description: This issue or pull request involves changes to existing functionality
1013
name: breaking change
11-
- color: "d73a4a"
14+
- color: d73a4a
1215
description: This issue or pull request addresses broken functionality
1316
name: bug
14-
- color: "07648d"
17+
- color: 07648d
1518
description: This issue will be advertised on code.gov's Open Tasks page (https://code.gov/open-tasks)
1619
name: code.gov
17-
- color: "0366d6"
20+
- color: 0366d6
1821
description: Pull requests that update a dependency file
1922
name: dependencies
20-
- color: "2497ed"
23+
- color: 2497ed
2124
description: Pull requests that update Docker code
2225
name: docker
23-
- color: "5319e7"
26+
- color: 5319e7
2427
description: This issue or pull request improves or adds to documentation
2528
name: documentation
26-
- color: "cfd3d7"
29+
- color: cfd3d7
2730
description: This issue or pull request already exists or is covered in another issue or pull request
2831
name: duplicate
29-
- color: "b005bc"
32+
- color: b005bc
3033
description: A high-level objective issue encompassing multiple issues instead of a specific unit of work
3134
name: epic
3235
- color: "000000"
3336
description: Pull requests that update GitHub Actions code
3437
name: github-actions
35-
- color: "0e8a16"
38+
- color: 0e8a16
3639
description: This issue or pull request is well-defined and good for newcomers
3740
name: good first issue
38-
- color: "ff7518"
41+
- color: ff7518
3942
description: Pull request that should count toward Hacktoberfest participation
4043
name: hacktoberfest-accepted
41-
- color: "a2eeef"
44+
- color: a2eeef
4245
description: This issue or pull request will add or improve functionality, maintainability, or ease of use
4346
name: improvement
44-
- color: "fef2c0"
47+
- color: fef2c0
4548
description: This issue or pull request is not applicable, incorrect, or obsolete
4649
name: invalid
47-
- color: "ce099a"
50+
- color: f1d642
51+
description: Pull requests that update JavaScript code
52+
name: javascript
53+
- color: ce099a
4854
description: This pull request is ready to merge during the next Lineage Kraken release
4955
name: kraken 🐙
50-
- color: "a4fc5d"
56+
- color: a4fc5d
5157
description: This issue or pull request requires further information
5258
name: need info
53-
- color: "fcdb45"
59+
- color: fcdb45
5460
description: This pull request is awaiting an action or decision to move forward
5561
name: on hold
56-
- color: "3772a4"
62+
- color: 02a8ef
63+
description: Pull requests that update Packer code
64+
name: packer
65+
- color: 3772a4
5766
description: Pull requests that update Python code
5867
name: python
59-
- color: "ef476c"
68+
- color: ef476c
6069
description: This issue is a request for information or needs discussion
6170
name: question
62-
- color: "d73a4a"
71+
- color: d73a4a
6372
description: This issue or pull request addresses a security issue
6473
name: security
65-
- color: "00008b"
74+
- color: 7b42bc
75+
description: Pull requests that update Terraform code
76+
name: terraform
77+
- color: 00008b
6678
description: This issue or pull request adds or otherwise modifies test code
6779
name: test
68-
- color: "1d76db"
80+
- color: 2b6ebf
81+
description: Pull requests that update TypeScript code
82+
name: typescript
83+
- color: 1d76db
6984
description: This issue or pull request pulls in upstream updates
7085
name: upstream update
71-
- color: "d4c5f9"
86+
- color: d4c5f9
7287
description: This issue or pull request increments the version number
7388
name: version bump
74-
- color: "ffffff"
89+
- color: ffffff
7590
description: This issue will not be incorporated
7691
name: wontfix

.github/lineage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
lineage:
33
skeleton:
44
remote-url: https://github.com/cisagov/skeleton-docker.git
5-
version: '1'
5+
version: "1"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: Provide repository metadata
3+
4+
on: # yamllint disable-line rule:truthy
5+
workflow_call:
6+
outputs:
7+
image-name:
8+
description: The name of the Docker image.
9+
value: ${{ jobs.output-repo-metadata.outputs.image-name }}
10+
image-platforms:
11+
description: The supported platforms for the Docker image.
12+
value: ${{ jobs.output-repo-metadata.outputs.image-platforms }}
13+
14+
jobs:
15+
output-repo-metadata:
16+
name: Generate outputs for repository metadata
17+
outputs:
18+
image-name: ${{ steps.set-outputs.outputs.image-name }}
19+
image-platforms: ${{ steps.set-outputs.outputs.image-platforms }}
20+
permissions: {}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Set outputs for repository metadata
24+
id: set-outputs
25+
run: |
26+
# Standard Python Libraries
27+
import json
28+
import os
29+
import sys
30+
from typing import Any, TypedDict
31+
32+
33+
class GhaOutput(TypedDict):
34+
35+
description: str
36+
name: str
37+
value: Any
38+
39+
40+
# Every output in this list must be configured as an output for the workflow.
41+
gha_outputs: list[GhaOutput] = [
42+
{
43+
"description": "The name of the Docker image.",
44+
"name": "image-name",
45+
"value": "cisagov/saver",
46+
},
47+
{
48+
"description": "The supported platforms for the Docker image.",
49+
"name": "image-platforms",
50+
"value": [
51+
"linux/386",
52+
"linux/amd64",
53+
"linux/arm/v6",
54+
"linux/arm/v7",
55+
"linux/arm64",
56+
"linux/ppc64le",
57+
"linux/riscv64",
58+
"linux/s390x",
59+
],
60+
},
61+
]
62+
63+
if os.getenv("GITHUB_OUTPUT") is None:
64+
print(
65+
"GITHUB_OUTPUT is not set. "
66+
"This script is intended to be run in a GitHub Actions environment."
67+
)
68+
sys.exit(1)
69+
70+
with open(os.environ["GITHUB_OUTPUT"], "a") as gh_output:
71+
for output in gha_outputs:
72+
if any(isinstance(output["value"], t) for t in [list, dict]):
73+
output["value"] = json.dumps(output["value"])
74+
gh_output.write(f"{output['name']}={output['value']}\n")
75+
shell: python3 {0}

0 commit comments

Comments
 (0)