Skip to content

update gitignore

update gitignore #110

name: "Terraform Merge Actions"
on:
push:
branches:
- main
env:
APSTRA_URL: "${{ secrets.APSTRA_URL }}"
APSTRA_USER: "${{ secrets.APSTRA_USER }}"
APSTRA_PASS: "${{ secrets.APSTRA_PASS }}"
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
PR_NUMBER: "${{ github.event.number }}"
jobs:
terraform:
name: "Terraform Merge"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/github-script@v6
id: get_issue_number
with:
script: |
if (context.issue.number) {
// Return issue number if present
return context.issue.number;
} else {
// Otherwise return issue number from commit
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0].number;
}
result-encoding: string
- name: Set up Terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: 1.5.5
- name: Terraform Init
run: cd vpn && terraform init
- id: apply
name: Terraform Apply
run: |
cd vpn
export COMMENT="PR #${{steps.get_issue_number.outputs.result}} Merged by $GITHUB_TRIGGERING_ACTOR"
terraform apply -no-color --auto-approve
terraform apply -no-color --auto-approve