Skip to content

Add check for external contributor #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/docs-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,27 @@ env:
DOMAIN_PROD: "docs.nginx.com"

jobs:
checks:
name: Checks and variables
runs-on: ubuntu-22.04
permissions:
contents: read
outputs:
forked_workflow: ${{ steps.vars.outputs.forked_workflow }}
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set Variables
id: vars
run: |
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
- name: Output variables
run: |
echo forked_workflow: ${{ steps.vars.outputs.forked_workflow }}
build:
needs: [checks]
if: ${{ needs.checks.outputs.forked_workflow == 'false' }}
runs-on: ubuntu-latest
env:
# Remapping of inputs to envs
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ _note: autodeploy from branch is currently in progress. This docs will be update

## Usage

_note: This action **will not work** with Pull Requests on forked repositories. 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 from running on forked repositories._

### Security considerations
`AZURE_CREDENTIALS` need to contain service principal credentials with the following roles assigned;
- **Storage Blob Data Contributor**
Expand Down