Skip to content

Commit 8a13911

Browse files
committed
Add forked repo check and readme not
1 parent 03a9a38 commit 8a13911

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/docs-build-push.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,26 @@ env:
5050
DOMAIN_PROD: "docs.nginx.com"
5151

5252
jobs:
53+
checks:
54+
name: Checks and variables
55+
runs-on: ubuntu-22.04
56+
permissions:
57+
contents: read
58+
outputs:
59+
forked_workflow: ${{ steps.vars.outputs.forked_workflow }}
60+
steps:
61+
- name: Checkout Repository
62+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
63+
64+
- name: Set Variables
65+
id: vars
66+
run: |
67+
echo "forked_workflow=${{ (github.event.pull_request && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || !(startsWith(github.repository, 'nginx/') || startsWith(github.repository, 'nginxinc/')) }}" >> $GITHUB_OUTPUT
68+
- name: Output variables
69+
run: |
70+
echo forked_workflow: ${{ steps.vars.outputs.forked_workflow }}
5371
build:
72+
needs: [checks]
5473
runs-on: ubuntu-latest
5574
env:
5675
# Remapping of inputs to envs

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ _note: autodeploy from branch is currently in progress. This docs will be update
2222

2323
## Usage
2424

25+
_note: This action **will not work** with forked Pull Requests. Github does not allow secrets to be shared with forked Pull Requests. Secrets are required as part of Azure interactions. The "Checks and variables" job stops this action running
26+
and forked requests._
27+
2528
### Security considerations
2629
`AZURE_CREDENTIALS` need to contain service principal credentials with the following roles assigned;
2730
- **Storage Blob Data Contributor**

0 commit comments

Comments
 (0)