Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 434e07cdf1 | |||
| a0794878d6 | |||
| 133b919d67 | |||
| 0d1f3c2c81 | |||
| d73953d54c | |||
| 789dd0a7fa | |||
| a52aff510e |
@@ -1,45 +0,0 @@
|
|||||||
# `dist/index.js` is a special file in Actions.
|
|
||||||
# When you reference an action with `uses:` in a workflow,
|
|
||||||
# `index.js` is the code that will run.
|
|
||||||
# For our project, we generate this file through a build process
|
|
||||||
# from other source files.
|
|
||||||
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
|
|
||||||
name: Check dist/
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-dist:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
|
|
||||||
- name: Rebuild the dist/ directory
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Compare the expected and actual dist/ directories
|
|
||||||
run: |
|
|
||||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
|
||||||
echo "Detected uncommitted changes after build. See status below:"
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
id: diff
|
|
||||||
|
|
||||||
# If index.js was different than expected, upload the expected version as an artifact
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
|
||||||
with:
|
|
||||||
name: dist
|
|
||||||
path: dist/
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ci:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
- run: npm run style:check
|
|
||||||
- run: npm test
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [ "main" ]
|
|
||||||
schedule:
|
|
||||||
- cron: '32 12 * * 3'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
language: [ 'javascript' ]
|
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
||||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v3
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
|
|
||||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
||||||
# queries: security-extended,security-and-quality
|
|
||||||
|
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v3
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
|
|
||||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
||||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
||||||
|
|
||||||
# - run: |
|
|
||||||
# echo "Run, Build Application using script"
|
|
||||||
# ./location_of_script_within_repo/buildscript.sh
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v3
|
|
||||||
@@ -1,363 +0,0 @@
|
|||||||
name: Integration
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-return:
|
|
||||||
name: 'Integration test: return'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- id: output-set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: return core.getInput('input-value')
|
|
||||||
result-encoding: string
|
|
||||||
input-value: output
|
|
||||||
- run: |
|
|
||||||
echo "- Validating output is produced"
|
|
||||||
expected="output"
|
|
||||||
if [[ "${{steps.output-set.outputs.result}}" != "$expected" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected '$expected', got ${{steps.output-set.outputs.result}}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
test-relative-require:
|
|
||||||
name: 'Integration test: relative-path require'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- id: relative-require
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: return require('./package.json').name
|
|
||||||
result-encoding: string
|
|
||||||
- run: |
|
|
||||||
echo "- Validating relative require output"
|
|
||||||
expected="@actions/github-script"
|
|
||||||
if [[ "${{steps.relative-require.outputs.result}}" != "$expected" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected '$expected', got ${{steps.relative-require.outputs.result}}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
test-npm-require:
|
|
||||||
name: 'Integration test: npm package require'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
- id: npm-require
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: return require('@actions/core/package.json').name
|
|
||||||
result-encoding: string
|
|
||||||
- run: |
|
|
||||||
echo "- Validating npm require output"
|
|
||||||
expected="@actions/core"
|
|
||||||
if [[ "${{steps.npm-require.outputs.result}}" != "$expected" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected '$expected', got ${{steps.npm-require.outputs.result}}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
test-previews:
|
|
||||||
name: 'Integration test: GraphQL previews option'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
- id: previews-default
|
|
||||||
name: Default previews not set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({url: "/graphql"}).headers.accept
|
|
||||||
result-encoding: string
|
|
||||||
- id: previews-set-single
|
|
||||||
name: Previews set to a single value
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
previews: foo
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({url: "/graphql"}).headers.accept
|
|
||||||
result-encoding: string
|
|
||||||
- id: previews-set-multiple
|
|
||||||
name: Previews set to comma-separated list
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
previews: foo,bar,baz
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({url: "/graphql"}).headers.accept
|
|
||||||
result-encoding: string
|
|
||||||
- run: |
|
|
||||||
echo "- Validating previews default"
|
|
||||||
expected="application/vnd.github.v3+json"
|
|
||||||
if [[ "${{steps.previews-default.outputs.result}}" != $expected ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected '$expected', got ${{steps.previews-default.outputs.result}}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "- Validating previews set to a single value"
|
|
||||||
expected="application/vnd.github.foo-preview+json"
|
|
||||||
if [[ "${{steps.previews-set-single.outputs.result}}" != $expected ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected '$expected', got ${{steps.previews-set-single.outputs.result}}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "- Validating previews set to multiple values"
|
|
||||||
expected="application/vnd.github.foo-preview+json,application/vnd.github.bar-preview+json,application/vnd.github.baz-preview+json"
|
|
||||||
if [[ "${{steps.previews-set-multiple.outputs.result}}" != $expected ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected '$expected', got ${{steps.previews-set-multiple.outputs.result}}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
test-user-agent:
|
|
||||||
name: 'Integration test: user-agent option'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
- id: user-agent-default
|
|
||||||
name: Default user-agent not set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({}).headers['user-agent']
|
|
||||||
result-encoding: string
|
|
||||||
- id: user-agent-set
|
|
||||||
name: User-agent set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
user-agent: foobar
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({}).headers['user-agent']
|
|
||||||
result-encoding: string
|
|
||||||
- id: user-agent-empty
|
|
||||||
name: User-agent set to an empty string
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
user-agent: ''
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({}).headers['user-agent']
|
|
||||||
result-encoding: string
|
|
||||||
- run: |
|
|
||||||
# User-agent format: <prefix> [actions_orchestration_id/<id>] octokit-core.js/<version> ...
|
|
||||||
# When ACTIONS_ORCHESTRATION_ID is set, the orchestration ID is inserted after the prefix
|
|
||||||
echo "- Validating user-agent default"
|
|
||||||
ua="${{steps.user-agent-default.outputs.result}}"
|
|
||||||
if [[ "$ua" != "actions/github-script"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected user-agent to start with 'actions/github-script' and contain 'octokit-core.js/', got $ua"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "- Validating user-agent set to a value"
|
|
||||||
ua="${{steps.user-agent-set.outputs.result}}"
|
|
||||||
if [[ "$ua" != "foobar"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected user-agent to start with 'foobar' and contain 'octokit-core.js/', got $ua"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "- Validating user-agent set to an empty string"
|
|
||||||
ua="${{steps.user-agent-empty.outputs.result}}"
|
|
||||||
if [[ "$ua" != "actions/github-script"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected user-agent to start with 'actions/github-script' and contain 'octokit-core.js/', got $ua"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
test-get-octokit:
|
|
||||||
name: 'Integration test: getOctokit with token'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
- id: secondary-client
|
|
||||||
name: Create a second client with getOctokit
|
|
||||||
uses: ./
|
|
||||||
env:
|
|
||||||
APP_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const appOctokit = getOctokit(process.env.APP_TOKEN)
|
|
||||||
const {data} = await appOctokit.rest.repos.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo
|
|
||||||
})
|
|
||||||
|
|
||||||
return `${appOctokit !== github}:${data.full_name}`
|
|
||||||
result-encoding: string
|
|
||||||
- run: |
|
|
||||||
echo "- Validating secondary client output"
|
|
||||||
expected="true:${{ github.repository }}"
|
|
||||||
if [[ "${{steps.secondary-client.outputs.result}}" != "$expected" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected '$expected', got ${{steps.secondary-client.outputs.result}}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
test-debug:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
environment: ['', 'debug-integration-test']
|
|
||||||
environment:
|
|
||||||
name: ${{ matrix.environment }}
|
|
||||||
deployment: false
|
|
||||||
name: "Integration test: debug option (runner.debug mode ${{ matrix.environment && 'enabled' || 'disabled' }})"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
- id: debug-default
|
|
||||||
name: Default debug not set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const log = github.log
|
|
||||||
return {
|
|
||||||
runnerDebugMode: core.isDebug(),
|
|
||||||
debug: log.debug === console.debug,
|
|
||||||
info: log.info === console.info
|
|
||||||
}
|
|
||||||
- id: debug-true
|
|
||||||
name: Debug set to true
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
debug: true
|
|
||||||
script: |
|
|
||||||
const log = github.log
|
|
||||||
return {
|
|
||||||
runnerDebugMode: core.isDebug(),
|
|
||||||
debug: log.debug === console.debug,
|
|
||||||
info: log.info === console.info
|
|
||||||
}
|
|
||||||
- id: debug-false
|
|
||||||
name: Debug set to false
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
debug: false
|
|
||||||
script: |
|
|
||||||
const log = github.log
|
|
||||||
return {
|
|
||||||
runnerDebugMode: core.isDebug(),
|
|
||||||
debug: log.debug === console.debug,
|
|
||||||
info: log.info === console.info
|
|
||||||
}
|
|
||||||
- id: evaluate-tests
|
|
||||||
name: Evaluate test outputs
|
|
||||||
env:
|
|
||||||
RDMODE: ${{ runner.debug == '1' }}
|
|
||||||
run: |
|
|
||||||
# tests table, pipe separated: label | output | expected
|
|
||||||
# leading and trailing spaces on any field are trimmed
|
|
||||||
tests=$(cat << 'TESTS'
|
|
||||||
Validating debug default |\
|
|
||||||
${{ steps.debug-default.outputs.result }} |\
|
|
||||||
{"runnerDebugMode":${{ env.RDMODE }},"debug":${{ env.RDMODE }},"info":${{ env.RDMODE }}}
|
|
||||||
Validating debug set to true |\
|
|
||||||
${{ steps.debug-true.outputs.result }} |\
|
|
||||||
{"runnerDebugMode":${{ env.RDMODE }},"debug":true,"info":true}
|
|
||||||
Validating debug set to false |\
|
|
||||||
${{ steps.debug-false.outputs.result }} |\
|
|
||||||
{"runnerDebugMode":${{ env.RDMODE }},"debug":false,"info":false}
|
|
||||||
TESTS
|
|
||||||
)
|
|
||||||
|
|
||||||
strim() { shopt -s extglob; lt="${1##+( )}"; echo "${lt%%+( )}"; }
|
|
||||||
while IFS='|' read label output expected; do
|
|
||||||
label="$(strim "$label")"; output="$(strim "$output")"; expected="$(strim "$expected")"
|
|
||||||
echo -n "- $label:"
|
|
||||||
if [[ "$output" != "$expected" ]]; then
|
|
||||||
echo $'\n::error::\u274C' "Expected '$expected', got '$output'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $' \u2705'
|
|
||||||
done <<< "$tests"
|
|
||||||
|
|
||||||
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
test-base-url:
|
|
||||||
name: 'Integration test: base-url option'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
|
|
||||||
- id: base-url-default
|
|
||||||
name: API URL with base-url not set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({}).url
|
|
||||||
result-encoding: string
|
|
||||||
|
|
||||||
- id: base-url-default-graphql
|
|
||||||
name: GraphQL URL with base-url not set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({url: "/graphql"}).url
|
|
||||||
result-encoding: string
|
|
||||||
|
|
||||||
- id: base-url-set
|
|
||||||
name: API URL with base-url set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
base-url: https://my.github-enterprise-server.com/api/v3
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({}).url
|
|
||||||
result-encoding: string
|
|
||||||
|
|
||||||
- id: base-url-set-graphql
|
|
||||||
name: GraphQL URL with base-url set
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
base-url: https://my.github-enterprise-server.com/api/v3
|
|
||||||
script: |
|
|
||||||
const endpoint = github.request.endpoint
|
|
||||||
return endpoint({url: "/graphql"}).url
|
|
||||||
result-encoding: string
|
|
||||||
|
|
||||||
- run: |
|
|
||||||
echo "- Validating API URL default"
|
|
||||||
expected="https://api.github.com/"
|
|
||||||
actual="${{steps.base-url-default.outputs.result}}"
|
|
||||||
if [[ "$expected" != "$actual" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "- Validating GraphQL URL default"
|
|
||||||
expected="https://api.github.com/graphql"
|
|
||||||
actual="${{steps.base-url-default-graphql.outputs.result}}"
|
|
||||||
if [[ "$expected" != "$actual" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "- Validating base-url set to a value"
|
|
||||||
expected="https://my.github-enterprise-server.com/api/v3/"
|
|
||||||
actual="${{steps.base-url-set.outputs.result}}"
|
|
||||||
if [[ "$expected" != "$actual" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "- Validating GraphQL URL with base-url set to a value"
|
|
||||||
expected="https://my.github-enterprise-server.com/api/v3/graphql"
|
|
||||||
actual="${{steps.base-url-set-graphql.outputs.result}}"
|
|
||||||
if [[ "$expected" != "$actual" ]]; then
|
|
||||||
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
name: Licensed
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Check licenses
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # prefer to use a full fetch for licensed workflows
|
|
||||||
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0
|
|
||||||
with:
|
|
||||||
ruby-version: ruby
|
|
||||||
- uses: github/setup-licensed@v1
|
|
||||||
with:
|
|
||||||
version: '4.x'
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- uses: ./.github/actions/install-dependencies
|
|
||||||
- run: licensed status
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
name: 'Publish Immutable Action Version'
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checking out
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Publish
|
|
||||||
id: publish
|
|
||||||
uses: actions/publish-immutable-action@0.0.4
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
name: Pull Request Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
types: [opened, synchronize]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pull-request-test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
// Get the existing comments.
|
|
||||||
const {data: comments} = await github.rest.issues.listComments({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.payload.number,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Find any comment already made by the bot.
|
|
||||||
const botComment = comments.find(comment => comment.user.id === 41898282)
|
|
||||||
const commentBody = "Hello from actions/github-script! (${{ github.sha }})"
|
|
||||||
|
|
||||||
if (context.payload.pull_request.head.repo.full_name !== 'actions/github-script') {
|
|
||||||
console.log('Not attempting to write comment on PR from fork');
|
|
||||||
} else {
|
|
||||||
if (botComment) {
|
|
||||||
await github.rest.issues.updateComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
comment_id: botComment.id,
|
|
||||||
body: commentBody
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.payload.number,
|
|
||||||
body: commentBody
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user