BigSamu / OpenSearch_Changelog_Workflow

A reusable workflow for automating changelog and release notes generation processes for OpenSearch repos
Apache License 2.0
0 stars 4 forks source link

Setup Development and Production Environment for Workflow #43

Closed BigSamu closed 3 months ago

BigSamu commented 7 months ago

Currently the workflow has the URL for the Github Domain fixed to the deployment domain as follows:

export const GITHUB_APP_DOMAIN = "https://open-search-changeset-bot.vercel.app";

For development, each contributor has to change that URL with a tunnel service (for instance, ngrok) to be able to contribute in the GitHub App.

A solution to this problem is to setup this constant as an environmental variable in the .env file for development and in the workflow file for the working branch of OpenSearch-Dashboard for the changelog project pass the deployment URL as a parameter.

The setup for the GITHUB_APP_DOMAIN should be finally as follows:

export const GITHUB_APP_DOMAIN = process.env.ENV
  ? process.env.INPUT_GITHUB_APP_DOMAIN
  : process.env.GITHUB_APP_DOMAIN;

With the workflow file parse_changelog_workflow.yml passing an input as follows:

# Other code...
with:
     token: ${{secrets.GITHUB_TOKEN}}
     github_app_domain: 'https://open-search-changeset-bot.vercel.app'
     changeset_path: changelogs/fragments

And in the .env variable for the Reusable Workflow for OpenSearch_Parse_Changelog_Action, adding the tunnel domain for working in dev mode with the Github App

GITHUB_APP_DOMAIN='<your-tunnel-domain>'
BigSamu commented 3 months ago

This finally does not work as expected. Closing issue