Switch to a JavaScript action
This commit is contained in:
-15
@@ -1,15 +0,0 @@
|
||||
FROM alpine
|
||||
|
||||
LABEL "repository"="http://github.com/hmarr/debug-action"
|
||||
LABEL "homepage"="http://github.com/hmarr/debug-action"
|
||||
LABEL "maintainer"="Harry Marr <[email protected]>"
|
||||
|
||||
LABEL "com.github.actions.name"="Debug Action"
|
||||
LABEL "com.github.actions.description"="Log the action's environment variables and event payload"
|
||||
LABEL "com.github.actions.icon"="code"
|
||||
LABEL "com.github.actions.color"="yellow"
|
||||
|
||||
RUN apk --no-cache add jq
|
||||
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,8 @@
|
||||
name: 'Debug action'
|
||||
description: "Log the action's environment variables and event payload"
|
||||
branding:
|
||||
icon: 'code'
|
||||
color: 'yellow'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'index.js'
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
echo
|
||||
echo "-- Environment variables ----------------------------------------------"
|
||||
env
|
||||
echo "-----------------------------------------------------------------------"
|
||||
|
||||
echo
|
||||
echo "-- Event JSON ---------------------------------------------------------"
|
||||
cat "$GITHUB_EVENT_PATH" | jq -M .
|
||||
echo "-----------------------------------------------------------------------"
|
||||
echo
|
||||
@@ -0,0 +1,14 @@
|
||||
const fs = require("fs");
|
||||
|
||||
// Output environment variables. Secrets are automatically masked.
|
||||
console.log("::group::Environment variables")
|
||||
for (const [key, value] of Object.entries(process.env).sort()) {
|
||||
console.log(`${key}=${value}`);
|
||||
}
|
||||
console.log("::endgroup::")
|
||||
|
||||
// Output prettified event JSON.
|
||||
console.log("::group::Event JSON")
|
||||
const event = JSON.parse(fs.readFileSync(process.env["GITHUB_EVENT_PATH"]));
|
||||
console.log(JSON.stringify(event, null, 2));
|
||||
console.log("::endgroup::")
|
||||
Reference in New Issue
Block a user