Skip to content

Action-Test - [🩹 [Patch]: Add job to test GitHub Action commands #13] by @MariusStorhaug #127

Action-Test - [🩹 [Patch]: Add job to test GitHub Action commands #13] by @MariusStorhaug

Action-Test - [🩹 [Patch]: Add job to test GitHub Action commands #13] by @MariusStorhaug #127

Workflow file for this run

name: Action-Test
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
on:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
# ActionTestBasic:
# name: Action-Test - [Basic]
# runs-on: ubuntu-latest
# steps:
# # Need to check out as part of the test, as its a local action
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Action-Test
# uses: ./
# ActionTestWithScript:
# name: Action-Test - [WithScript]
# runs-on: ubuntu-latest
# steps:
# # Need to check out as part of the test, as its a local action
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Action-Test
# uses: ./
# with:
# Script: |
# LogGroup 'Get-GitHubZen' {
# Get-GitHubZen
# }
ActionTestCommands:
name: Action-Test - [Commands]
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4
- name: Action-Test
uses: ./
id: test
with:
Prerelease: true
Script: |
Get-ChildItem env: | Format-Table -AutoSize
# $cat = Get-GitHubOctocat
# $zen = Get-GitHubZen
# Set-Content -Path 'octocat.md' -Value $cat
# Set-GitHubEnvironmentVariable -Name 'OCTOCAT' -Value $cat
# # Set-GitHubOutput -Name 'WISECAT' -Value $cat -Verbose
# "ZEN=$zen" >> $env:GITHUB_OUTPUT
# 'WISECAT2<<EOF' >> $env:GITHUB_OUTPUT
# $cat >> $env:GITHUB_OUTPUT
# 'EOF' >> $env:GITHUB_OUTPUT
# Set-GitHubStepSummary -Summary $cat
# $env:GITHUB_ACTION
# $env:GITHUB_OUTPUT
# Get-Content $env:GITHUB_OUTPUT
- name: test
id: test2
shell: pwsh
run: |
Get-ChildItem env: | Format-Table -AutoSize
- name: Action-Test-Env
uses: ./
with:
Script: |
$env:OCTOCAT
- name: Action-Test-Output
uses: ./
env:
WISECAT: ${{ steps.test.outputs.WISECAT }}
ZEN: ${{ steps.test2.outputs.ZEN }}
with:
Script: |
"Wisecat"
$env:WISECAT
"Zen"
$env:ZEN
# ActionTestWithoutToken:
# name: Action-Test - [WithoutToken]
# runs-on: ubuntu-latest
# steps:
# # Need to check out as part of the test, as its a local action
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Action-Test
# uses: ./
# with:
# Token: ''
# Script: |
# LogGroup 'My group' {
# 'This is a group'
# }
# ActionTestWithPAT:
# name: Action-Test - [WithPAT]
# runs-on: ubuntu-latest
# steps:
# # Need to check out as part of the test, as its a local action
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Action-Test
# uses: ./
# with:
# Token: ${{ secrets.TEST_PAT }}
# Script: |
# LogGroup 'Get-GitHubUser' {
# Get-GitHubUser | Format-Table -AutoSize
# }
# ActionTestWithFGPAT:
# name: Action-Test - [WithFGPAT]
# runs-on: ubuntu-latest
# steps:
# # Need to check out as part of the test, as its a local action
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Action-Test
# uses: ./
# with:
# Token: ${{ secrets.TEST_FG_PAT }}
# Script: |
# LogGroup 'Get-GitHubUser' {
# Get-GitHubUser | Format-Table -AutoSize
# }
# ActionTestWithGitHubApp:
# name: Action-Test - [GitHubApp]
# runs-on: ubuntu-latest
# steps:
# # Need to check out as part of the test, as its a local action
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Action-Test
# uses: ./
# with:
# ClientID: ${{ secrets.TEST_APP_CLIENT_ID }}
# PrivateKey: ${{ secrets.TEST_APP_PRIVATE_KEY }}
# Script: |
# LogGroup 'Get-GitHubApp' {
# Get-GitHubApp | Format-Table -AutoSize
# }
# LogGroup 'Get-GitHubAppInstallation' {
# Get-GitHubAppInstallation | Format-Table -AutoSize
# }
# LogGroup 'Do something as an installation' {
# Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
# Connect-GitHub -Token $_.token -Silent
# Get-GitHubContext | Format-Table -AutoSize
# Get-GitHubGitConfig | Format-Table -AutoSize
# }
# }