Skip to content

Commit d989d9f

Browse files
feat: Add security-gates and update README (#16)
* Add security-gates workflow and update README * Add security-gates workflow and update README * Add security-gates workflow and update README
1 parent 9fd69fd commit d989d9f

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
name: Scorecard supply-chain security
3+
4+
on:
5+
branch_protection_rule:
6+
schedule:
7+
- cron: '29 23 * * 3'
8+
push:
9+
branches: [ "main", "master"]
10+
pull_request:
11+
branches: ["main", "master"]
12+
13+
permissions: read-all
14+
15+
jobs:
16+
visibility-check:
17+
# Bu job, deponun public/private olduğunu belirler
18+
outputs:
19+
visibility: ${{ steps.drv.outputs.visibility }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Determine repository visibility
23+
id: drv
24+
run: |
25+
visibility=$(gh api /repos/$GITHUB_REPOSITORY --jq '.visibility')
26+
echo "visibility=$visibility" >> $GITHUB_OUTPUT
27+
env:
28+
GH_TOKEN: ${{ github.token }}
29+
30+
analysis:
31+
if: ${{ needs.visibility-check.outputs.visibility == 'public' }}
32+
needs: visibility-check
33+
runs-on: ubuntu-latest
34+
permissions:
35+
security-events: write
36+
id-token: write
37+
steps:
38+
- name: "Checkout code"
39+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
40+
with:
41+
persist-credentials: false
42+
43+
- name: "Run analysis"
44+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736
45+
with:
46+
results_file: results.sarif
47+
results_format: sarif
48+
publish_results: true
49+
50+
- name: "Upload artifact"
51+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
52+
with:
53+
name: SARIF file
54+
path: results.sarif
55+
retention-days: 5
56+
57+
# Upload the results to GitHub's code scanning dashboard (optional).
58+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
59+
- name: "Upload to code-scanning"
60+
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
61+
with:
62+
sarif_file: results.sarif
63+
64+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Security Gates
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
validate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Validate Workflow
14+
run: echo "Validation successful"
15+
16+
security-gates:
17+
uses: Trendyol/security-actions/.github/workflows/security-gates.yml@master
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Trendyol/PollingOutboxPublisher/badge)](https://scorecard.dev/viewer/?uri=github.com/Trendyol/PollingOutboxPublisher)
13
# PollingOutboxPublisher
24

35
## Contents

0 commit comments

Comments
 (0)