Skip to content

Commit 9b8436b

Browse files
Merge pull request #5 from codingforentrepreneurs/dev
Automated Pull Request from dev
2 parents 6910995 + 8f7622e commit 9b8436b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/stage-app.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ jobs:
1313
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
1414
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1515
STAGE: dev
16+
GH_TOKEN: ${{ github.token }}
1617
steps:
1718
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
1821
- name: Use Node.js
1922
uses: actions/setup-node@v4
2023
with:
@@ -37,13 +40,9 @@ jobs:
3740
run: npm run deploy-dev-stage
3841
- name: Stage Info
3942
run: |
40-
export STAGE_INFO=$(npx serverless info --stage dev --region us-east-2) >> $GITHUB_ENV
41-
- name: Create Pull Request to Main
42-
uses: peter-evans/create-pull-request@v5
43-
with:
44-
token: ${{ secrets.GITHUB_TOKEN }}
45-
commit-message: "Automated PR from Dev to Main"
46-
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
47-
title: "Dev Staged"
48-
body: "This is an automated pull request to merge changes from the Dev branch into Main. $STAGE_INFO"
49-
branch: "main"
43+
echo 'STAGE_INFO=$(npx serverless info --stage dev --region us-east-2)' >> $GITHUB_ENV
44+
- name: Create Pull Request
45+
run: |
46+
PR_BRANCH=$(git branch --show-current)
47+
DEFAULT_BRANCH=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
48+
gh pr create --title "Automated Pull Request from $PR_BRANCH" --body "Dev Stage Relased:$STAGE_INFO" --base $DEFAULT_BRANCH --head $PR_BRANCH --repo $GITHUB_REPOSITORY

src/lib/secrets.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const { SSMClient,
55
const AWS_REGION='us-east-2'
66
const STAGE = process.env.STAGE || 'prod'
77

8+
console.log('test')
89
async function getDatabaseUrl(){
910
const DATABASE_URL_SSM_PARAM=`/serverless-nodejs-api/${STAGE}/database-url`
1011
const client = new SSMClient({region: AWS_REGION})

0 commit comments

Comments
 (0)