File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 2323 required : false
2424 default : ' ubuntu-latest'
2525 type : string
26+ repo-owner :
27+ description : ' Repository owner/organization allowed to run this workflow'
28+ required : false
29+ default : ' electricbookworks'
30+ type : string
2631
2732jobs :
33+ owner-check :
34+ runs-on : ${{ inputs.runner }}
35+ outputs :
36+ is_allowed_owner : ${{ steps.check_owner.outputs.is_allowed_owner }}
37+ steps :
38+ - name : Check repository owner
39+ id : check_owner
40+ run : |
41+ REPO_OWNER="${{ github.repository_owner }}"
42+ ALLOWED_OWNER="${{ inputs.repo-owner }}"
43+ if [ "$REPO_OWNER" != "$ALLOWED_OWNER" ]; then
44+ echo "⚠️ Repository owner '$REPO_OWNER' is not '$ALLOWED_OWNER'. Skipping workflow execution."
45+ echo "is_allowed_owner=false" >> $GITHUB_OUTPUT
46+ else
47+ echo "✅ Repository owner '$REPO_OWNER' is authorized. Proceeding with workflow."
48+ echo "is_allowed_owner=true" >> $GITHUB_OUTPUT
49+ fi
50+
2851 pre-check :
52+ needs : owner-check
53+ if : needs.owner-check.outputs.is_allowed_owner == 'true'
2954 runs-on : ${{ inputs.runner }}
3055 outputs :
3156 skip_book_server : ${{ steps.check_config.outputs.skip_book_server }}
Original file line number Diff line number Diff line change 2323
2424Replace ` {release-version}` with the latest release (e.g. `v2.0.2`), unless you want to use an older version.
2525
26- You can also add optional inputs to customise the Ruby and Node versions, as well as the config file location :
26+ You can also provide the following optional inputs, under the `with` property :
2727
2828` ` ` yaml
2929name: Deploy to Electric Book Server and S3
4040 config-file: '.github/workflows/deploy.config.json' # optional - defaults to '.github/workflows/deploy.config.json'
4141 node-version: '22' # optional - defaults to 22
4242 runner: 'Linux-4core-16gb-ram-150gb-sso' # optional - defaults to 'ubuntu-latest'
43+ repo-owner: 'electricbookworks' # optional - defaults to 'electricbookworks' - if not a match, workflow will be skipped
4344` ` `
4445
4546# ## 2. Create your deployment configuration
You can’t perform that action at this time.
0 commit comments