-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.21 KB
/
github_script.yml
File metadata and controls
39 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Test GitHub script
on:
workflow_dispatch:
jobs:
build-container:
name: Test some script
runs-on: ubuntu-latest
steps:
- run: |
echo "Hello World"
test-script:
needs: build-container
name: Test some script
runs-on: ubuntu-latest
steps:
- name: Test building a URL from github context
uses: actions/github-script@v6
with:
script: |
const run_url = github.server_url + '/' + github.repository + '/actions/runs/' + github.run_id
message = "This is a message"
message += '\n' + run_url
console.log(message)
- name: Test using Environment variables within JavaScript
uses: actions/github-script@v6
env:
FOO: BAR
with:
script: |
const { FOO } = process.env
if (`${FOO}` == 'BAR') {
console.log("True")
}
console.log('https://${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id}}')
console.log('needs.build-container.result = ${{ needs.build-container.result }}')
console.log(`FOO = ${FOO}`)
console.log(${{ github.server_url }})