Skip to content

Commit cdf0921

Browse files
author
James Brundage
committed
feat: Using Action and adding example ( Fixes #4, Fixes #5, Fixes #9 )
Using environment variable
1 parent 2b52dd4 commit cdf0921

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.github/workflows/BuildGQL.yml

+2
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ jobs:
507507
- name: Run GQL (on branch)
508508
uses: ./
509509
id: ActionOnBranch
510+
env:
511+
GitHubToken: ${{ secrets.GitHubToken }}
510512
- name: Log in to ghcr.io
511513
uses: docker/login-action@master
512514
with:

Build/GitHub/Jobs/BuildGQL.psd1

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
name = 'Run GQL (on branch)'
2828
uses = './'
2929
id = 'ActionOnBranch'
30+
env = @{
31+
GitHubToken = '${{ secrets.GitHubToken }}'
32+
}
3033
},
3134
'BuildAndPublishContainer'
3235
)

Examples/GitGraphTypes.gql.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#requires -Module GQL
2-
if (-not $GitHubToken) {
2+
if (-not $env:GitHubToken) {
33
Write-Warning "No GitHubToken found."
44
return
55
}
66

77
Push-Location $PSScriptRoot
88

99
# First, let's get the query
10-
gql -Query ./GetSchemaTypes.gql -PersonalAccessToken $GitHubToken -Cache -OutputPath ./GitHubGraphTypes.json
10+
gql -Query ./GetSchemaTypes.gql -PersonalAccessToken $env:GitHubToken -Cache -OutputPath ./GitHubGraphTypes.json
1111

1212
Pop-Location

0 commit comments

Comments
 (0)