Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMWT_24WS_Gruppe02
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Frickel
DMWT_24WS_Gruppe02
Commits
0dd9b32b
Unverified
Commit
0dd9b32b
authored
5 months ago
by
SurpriseChan
Committed by
GitHub
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Create neon-preview-branches-for-pull-requests-sweet-dew-81614885.yml
parent
9e9c25e5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/neon-preview-branches-for-pull-requests-sweet-dew-81614885.yml
+73
-0
73 additions, 0 deletions
...preview-branches-for-pull-requests-sweet-dew-81614885.yml
with
73 additions
and
0 deletions
.github/workflows/neon-preview-branches-for-pull-requests-sweet-dew-81614885.yml
0 → 100644
+
73
−
0
View file @
0dd9b32b
name
:
Create/Delete Branch for Pull Request
on
:
pull_request
:
types
:
-
opened
-
reopened
-
synchronize
-
closed
concurrency
:
group
:
${{ github.workflow }}-${{ github.ref }}
jobs
:
setup
:
name
:
Setup
outputs
:
branch
:
${{ steps.branch_name.outputs.current_branch }}
runs-on
:
ubuntu-latest
steps
:
-
name
:
Get branch name
id
:
branch_name
uses
:
tj-actions/branch-names@v8
create_neon_branch
:
name
:
Create Neon Branch
outputs
:
db_url
:
${{ steps.create_neon_branch_encode.outputs.db_url }}
db_url_with_pooler
:
${{ steps.create_neon_branch_encode.outputs.db_url_with_pooler }}
needs
:
setup
if
:
|
github.event_name == 'pull_request' && (
github.event.action == 'synchronize'
|| github.event.action == 'opened'
|| github.event.action == 'reopened')
runs-on
:
ubuntu-latest
steps
:
-
name
:
Create Neon Branch
id
:
create_neon_branch
uses
:
neondatabase/create-branch-action@v5
with
:
project_id
:
${{ vars.NEON_PROJECT_ID }}
branch_name
:
preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
api_key
:
${{ secrets.NEON_API_KEY }}
# The step above creates a new Neon branch.
# You may want to do something with the new branch, such as run migrations, run tests
# on it, or send the connection details to a hosting platform environment.
# The branch DATABASE_URL is available to you via:
# "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}".
# It's important you don't log the DATABASE_URL as output as it contains a username and
# password for your database.
# For example, you can uncomment the lines below to run a database migration command:
# - name: Run Migrations
# run: npm run db:migrate
# env:
# # to use pooled connection
# DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}"
# # OR to use unpooled connection
# # DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url }}"
delete_neon_branch
:
name
:
Delete Neon Branch
needs
:
setup
if
:
github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on
:
ubuntu-latest
steps
:
-
name
:
Delete Neon Branch
uses
:
neondatabase/delete-branch-action@v3
with
:
project_id
:
${{ vars.NEON_PROJECT_ID }}
branch
:
preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
api_key
:
${{ secrets.NEON_API_KEY }}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment