forked from BetaHuhn/repo-file-sync-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from cds-snc/feat/initial_changes
Feat/initial changes
- Loading branch information
Showing
26 changed files
with
592 additions
and
1,885 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node | ||
{ | ||
"name": "repo-file-sync-action", | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye", | ||
"features": {}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"redhat.vscode-yaml", | ||
"github.actions", | ||
"github.copilot", | ||
"ms-vscode.vscode-node-azure-pack", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"github.vscode-pull-request-github", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
}, | ||
"codespaces": { | ||
"extensions": [ | ||
"redhat.vscode-yaml", | ||
"github.actions", | ||
"github.copilot", | ||
"ms-vscode.vscode-node-azure-pack", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"github.vscode-pull-request-github", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: GitHub repository metadata exporter | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 7 * * *" | ||
|
||
jobs: | ||
export-data: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@3ba5ee6fac7e0e30e2ea884e236f282d3a775891 | ||
- name: Export Data | ||
uses: cds-snc/github-repository-metadata-exporter@main | ||
with: | ||
github-app-id: ${{ secrets.SRE_BOT_RO_APP_ID }} | ||
github-app-installation-id: ${{ secrets.SRE_BOT_RO_INSTALLATION_ID }} | ||
github-app-private-key: ${{ secrets.SRE_BOT_RO_PRIVATE_KEY }} | ||
log-analytics-workspace-id: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }} | ||
log-analytics-workspace-key: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
on: [issues, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
sync-labels: | ||
runs-on: ubuntu-latest | ||
name: Sync repository labels | ||
steps: | ||
- uses: cds-snc/labels@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Scorecards supply-chain security | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# Weekly on Saturdays. | ||
- cron: "30 1 * * 6" | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
analysis: | ||
name: Scorecards analysis | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: "Run analysis" | ||
uses: ossf/scorecard-action@bfa3f0d2c52a31cf9f6bc003e1f15e8b99640aec | ||
with: | ||
results_file: ossf-results.json | ||
results_format: json | ||
publish_results: false | ||
|
||
- name: "Add metadata" | ||
run: | | ||
full_repo="${{ github.repository }}" | ||
OWNER=${full_repo%/*} | ||
REPO=${full_repo#*/} | ||
jq -c '. + {"metadata_owner": "'$OWNER'", "metadata_repo": "'$REPO'", "metadata_query": "ossf"}' ossf-results.json > ossf-results-modified.json | ||
- name: "Post results to Sentinel" | ||
uses: cds-snc/sentinel-forward-data-action@main | ||
with: | ||
file_name: ossf-results-modified.json | ||
log_type: GitHubMetadata_OSSF_Scorecard | ||
log_analytics_workspace_id: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }} | ||
log_analytics_workspace_key: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: S3 backup | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 6 * * *" | ||
|
||
jobs: | ||
s3-backup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # retrieve all history | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_S3_BACKUP_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_S3_BACKUP_SECRET_ACCESS_KEY }} | ||
aws-region: ca-central-1 | ||
|
||
- name: Create ZIP bundle | ||
run: | | ||
ZIP_FILE=`basename ${{ github.repository }}`-`date '+%Y-%m-%d'`.zip | ||
zip -rq "${ZIP_FILE}" . | ||
mkdir -p ${{ github.repository }} | ||
mv "${ZIP_FILE}" ${{ github.repository }} | ||
- name: Upload to S3 bucket | ||
run: | | ||
aws s3 sync . s3://${{ secrets.AWS_S3_BACKUP_BUCKET }} --exclude='*' --include='${{ github.repository }}/*' | ||
- name: Notify Slack channel if this job failed | ||
if: ${{ failure() }} | ||
run: | | ||
json='{"text":"S3 backup failed in <https://github.com/${{ github.repository }}>!"}' | ||
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.SLACK_NOTIFY_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker run --rm -v "$PWD:/mnt" koalaman/shellcheck:v0.7.1 -P ./bin/ -x ./.github/workflows/scripts/*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Shellcheck | ||
on: | ||
push: | ||
paths: | ||
- "**/*.sh" | ||
|
||
jobs: | ||
shellcheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Shellcheck | ||
run: | | ||
.github/workflows/scripts/run-shellcheck.sh |
Oops, something went wrong.