Skip to content

complete deployment github-script-poc.yml #5

complete deployment github-script-poc.yml

complete deployment github-script-poc.yml #5

name: github-script-poc
on:
push:
jobs:
poc-test:
runs-on: ubuntu-latest
name: Sandbox Testing
steps:
# - name: View context attributes
# uses: actions/github-script@v7
# with:
# script: console.log(context)
- name: Register Sample Deployment
uses: actions/github-script@v4
with:
script: |
const deployment = await github.repos.createDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.ref,
auto_merge: false,
description: "Sample GitHub-Script Deployment",
required_contexts: [],
environment: "GitHub.Scripts (live)",
production_environment: true
});
console.log(deployment);
if (deployment.status === 201) {
core.setOutput('id', deployment.data.id);
return deployment.data;
} else {
throw ne