This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
fix(deps): update dependency express to v5.0.0-beta.3 [security] - autoclosed #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Preview workflow is dedicated for spinning off a development environments on terraform, for example for every PR opened to main there will be real-world environment setted up on infrastructure which will be destroyed after merge. | |
name: 👨💻 Preview | |
on: | |
workflow_call: | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
branches: | |
- main | |
env: | |
TF_CLOUD_ORGANIZATION: "${{ secrets.TF_CLOUD_ORGANIZATION }}" | |
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" | |
TF_WORKSPACE: "dev-${{ github.repository_id }}-${{ github.event.pull_request.number }}" | |
CONFIG_DIRECTORY: "./infrastructure/" | |
jobs: | |
spinoff_preivew_environment: | |
name: "spinoff-preview" | |
runs-on: luminar-linux-x64-x1 | |
permissions: | |
contents: read | |
packages: write | |
deployments: write | |
id-token: write | |
steps: | |
- name: 📜 Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 🐧 Setup OS | |
uses: "./.github/actions/setup-os" | |
- name: ✳️ Setup Node.js | |
uses: "./.github/actions/setup-node" | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
- name: Create Workspace | |
run: | | |
cd ${{ env.CONFIG_DIRECTORY }} | |
terraform workspace new ${{ env.TF_WORKSPACE }} || terraform workspace select ${{ env.TF_WORKSPACE }} | |
- run: | | |
cd ${{ env.CONFIG_DIRECTORY }} | |
sed -i 's/tags = \["plygrnd"\]/name = "'$TF_WORKSPACE'"/g' main.tf | |
terraform init -input=false | |
- name: Upload Configuration | |
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0 | |
id: upload-configuration | |
with: | |
organization: ${{ env.TF_CLOUD_ORGANIZATION }} | |
token: ${{ env.TF_API_TOKEN }} | |
workspace: ${{ env.TF_WORKSPACE }} | |
directory: ${{ env.CONFIG_DIRECTORY }} | |
speculative: false | |
- name: Create Plan Run | |
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.0.0 | |
id: create-run | |
with: | |
organization: ${{ env.TF_CLOUD_ORGANIZATION }} | |
token: ${{ env.TF_API_TOKEN }} | |
workspace: ${{ env.TF_WORKSPACE }} | |
configuration_version: ${{ steps.upload-configuration.outputs.configuration_version_id }} | |
plan_only: true | |
- name: Get Plan Output | |
uses: hashicorp/tfc-workflows-github/actions/plan-output@v1.0.0 | |
id: plan-output | |
with: | |
organization: ${{ env.TF_CLOUD_ORGANIZATION }} | |
token: ${{ env.TF_API_TOKEN }} | |
plan: ${{ fromJSON(steps.plan-run.outputs.payload).data.relationships.plan.data.id }} |