Skip to content

Commit ccc8052

Browse files
Merge pull request #188 from ansible-lockdown/devel
.github standardization
2 parents 6d24677 + b77f0a3 commit ccc8052

6 files changed

Lines changed: 128 additions & 25 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
3+
name: Add Repo Issue to ALD GH project
4+
on:
5+
issues:
6+
types:
7+
- opened
8+
- reopened
9+
- transferred
10+
jobs:
11+
add-to-project:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/add-to-project@main
15+
with:
16+
project-url: https://github.com/orgs/ansible-lockdown/projects/1
17+
github-token: ${{ secrets.ALD_GH_PROJECT }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
3+
# GitHub schedules all cron jobs in UTC.
4+
# ──────────────────────────────────────────────────────────────────────────────
5+
# Schedule:
6+
# - '0 13 * * *' runs at 13:00 UTC every day.
7+
# - This corresponds to:
8+
# • 9:00 AM Eastern **during Daylight Saving Time** (mid-Mar → early-Nov)
9+
# • 8:00 AM Eastern **during Standard Time** (early-Nov → mid-Mar)
10+
#
11+
# Job routing:
12+
# - call-benchmark-tracker:
13+
# • Runs on manual dispatch, and on pushes to the 'latest' branch.
14+
# - call-monitor-promotions:
15+
# • Runs on schedule or manual dispatch **only in repos named ansible-lockdown/Private-***.
16+
# • Skips automatically in public repos (e.g., Windows-2022-CIS) to avoid false failures.
17+
#
18+
# Defense-in-depth:
19+
# - The called promotion workflow may still keep its own guard to ensure only Private-* repos execute it.
20+
21+
name: Central Benchmark Orchestrator
22+
23+
on:
24+
push:
25+
branches:
26+
- latest
27+
schedule:
28+
- cron: '0 13 * * *' # 13:00 UTC → 9 AM ET (DST) / 8 AM ET (Standard Time)
29+
workflow_dispatch:
30+
31+
jobs:
32+
call-benchmark-tracker:
33+
# Run on manual dispatch OR when 'latest' branch receives a push
34+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_name == 'latest')
35+
name: Start Benchmark Tracker
36+
uses: ansible-lockdown/github_linux_IaC/.github/workflows/benchmark_track.yml@self_hosted
37+
with:
38+
repo_name: ${{ github.repository }}
39+
secrets:
40+
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
41+
BADGE_PUSH_TOKEN: ${{ secrets.BADGE_PUSH_TOKEN }}
42+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
43+
44+
call-monitor-promotions:
45+
# Run on schedule or manual dispatch, but only for Private-* repos
46+
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && startsWith(github.repository, 'ansible-lockdown/Private-')
47+
name: Monitor Promotions and Auto-Promote
48+
uses: ansible-lockdown/github_linux_IaC/.github/workflows/benchmark_promote.yml@self_hosted
49+
with:
50+
repo_name: ${{ github.repository }}
51+
secrets:
52+
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
53+
BADGE_PUSH_TOKEN: ${{ secrets.BADGE_PUSH_TOKEN }}
54+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}

.github/workflows/devel_pipeline_validation.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@
1717
# Allow manual running of workflow
1818
workflow_dispatch:
1919

20-
# Allow permissions for AWS auth
21-
permissions:
22-
id-token: write
23-
contents: read
24-
pull-requests: read
25-
2620
# A workflow run is made up of one or more jobs
2721
# that can run sequentially or in parallel
2822
jobs:
2923
# This will create messages for first time contributers and direct them to the Discord server
3024
welcome:
3125
runs-on: ubuntu-latest
3226

27+
permissions:
28+
issues: write
29+
pull-requests: write
30+
3331
steps:
3432
- uses: actions/first-interaction@main
3533
with:
@@ -45,6 +43,13 @@
4543
playbook-test:
4644
# The type of runner that the job will run on
4745
runs-on: self-hosted
46+
47+
# Allow permissions for AWS auth
48+
permissions:
49+
id-token: write
50+
contents: read
51+
pull-requests: read
52+
4853
env:
4954
ENABLE_DEBUG: ${{ vars.ENABLE_DEBUG }}
5055
# Imported as a variable by terraform
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
3+
name: Export Private Repo Badges
4+
5+
# Use different minute offsets with the same hourly pattern:
6+
# Repo Group Suggested Cron Expression Explanation
7+
# Group A 0 */6 * * * Starts at top of hour
8+
# Group B 10 */6 * * * Starts at 10 after
9+
# And So On
10+
11+
on:
12+
push:
13+
branches:
14+
- latest
15+
schedule:
16+
- cron: '0 */6 * * *'
17+
workflow_dispatch:
18+
19+
jobs:
20+
export-badges:
21+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'schedule' && startsWith(github.repository, 'ansible-lockdown/Private-')) || (github.event_name == 'push' && github.ref_name == 'latest')
22+
uses: ansible-lockdown/github_linux_IaC/.github/workflows/export_badges_private.yml@self_hosted
23+
with:
24+
# Full org/repo path passed for GitHub API calls (e.g., ansible-lockdown/Private-Windows-2016-CIS)
25+
repo_name: ${{ github.repository }}
26+
secrets:
27+
BADGE_PUSH_TOKEN: ${{ secrets.BADGE_PUSH_TOKEN }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
3+
name: Export Public Repo Badges
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
- devel
10+
workflow_dispatch:
11+
12+
jobs:
13+
export-badges:
14+
if: github.repository_visibility == 'public' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref_name == 'devel' || github.ref_name == 'main')))
15+
uses: ansible-lockdown/github_linux_IaC/.github/workflows/export_badges_public.yml@self_hosted
16+
with:
17+
repo_name: ${{ github.repository }}
18+
secrets:
19+
BADGE_PUSH_TOKEN: ${{ secrets.BADGE_PUSH_TOKEN }}

.github/workflows/update_galaxy.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)