Comments (10)
@peter-evans Could you please help me here
from create-pull-request.
@peter-evans Its a blocker for the current development. Could you please assist me?
from create-pull-request.
It's not clear to me what you are trying to do. Are you trying to make a pull request from an existing branch to main
without any changes?
The standard pattern for using this action is to checkout the target branch (main
) and then create the changes you want on top of that branch. So I think your workflow is a bit confusing, because your checking out the "branch to deploy" and then setting the base
input to main
. All this will do is take the changes you are making in the workflow and try to rebase them on main
. It's not raising a PR with changes that already exist in the branch
input of the workflow.
from create-pull-request.
@peter-evans Yes, I am trying to promote the changes from branch i.e test2 to main based on different inputs. I altered the workflow as below by referring to your documentation. I would like to create 2 pull requests for two different products pingfederate and pingdirectory. I copy the changes accordingly in git copy command based on the inputs from test folder to production folder as mentioned below. But the 2 pull requests has the changes from both the folders pingfederate and pingdirectory. Below are the expected changes in the pull requests. I can provide you more information.
Condition:
i) If the input is pingdirectory
The pull request created from test2 to main should have only the changes from below path.
nuuday-ciam/test/pingdirectory/
nuuday-ciam/production/pingdirectory/ - changes copied from nuuday-ciam/test/pingdirectory/
ii) If the input is pingfederate
The pull request created from test2 to main should have only the changes from below path.
nuuday-ciam/test/pingfederate/
nuuday-ciam/production/pingfederate/ - changes copied from nuuday-ciam/test/pingfederate/
name: "Start Promotion Staging->Production"
permissions:
contents: write
issues: write
pull-requests: write
on:
workflow_call:
inputs:
product:
description: 'ping product to promote'
required: true
type: string
branch:
description: 'branch to deploy'
required: true
type: string
jobs:
promote:
runs-on: ubuntu-latest
name: Promoting from test to production
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Reset promotion branch
run: |
git fetch origin ${{ inputs.branch }}:${{ inputs.branch }}
git reset --hard ${{ inputs.branch }}
- name: Copy PingDirectory
if: inputs.product == 'pingdirectory'
run: |
rm -rf ./nuuday-ciam/production/pingdirectory
cp -r nuuday-ciam/test/pingdirectory/ nuuday-ciam/production/pingdirectory
find ./nuuday-ciam/production/pingdirectory/ -name '*_test.*' -type f -delete
- name: Copy PingFederate
if: inputs.product == 'pingfederate'
run: |
npm install --dev --prefix .build
rm -rf nuuday-ciam/production/pingfederate
cp -r nuuday-ciam/test/pingfederate nuuday-ciam/production/pingfederate
find ./nuuday-ciam/production/pingfederate/ -name '*.css.map*' -type f -delete
npm run config:production --prefix .build
- name: Git status
run: git status
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.REPOSITORY_ROBOT_PAT }}
branch: "release/${{inputs.product}}-test-to-production"
commit-message: "chore(release): promoting ${{inputs.product}} from test to production"
title: "chore(release): promoting ${{inputs.product}} from test to production"
assignees: ${{ github.actor }}
labels: "automated promotion"
branch-suffix: short-commit-hash
body: |
THIS IS AN AUTOMATED PROMOTION FROM THE TEST ENVIRONMENT TO PRODUCTION ENVIRONMENT.
PLEASE REVIEW THE FILE CHANGES IN THIS PR AND MERGE IT WHEN YOU ARE READY.
WHEN THIS PR IS MERGED, THE CHANGES WILL BE AUTOMATICALLY DEPLOYED TO PRODUCTION.
from create-pull-request.
@peter-evans Hope the explanation in the above comment helps.
from create-pull-request.
@peter-evans Can you please assist with the above response? It will be of great help. The development activity can resume only if this is rectified.
from create-pull-request.
@peter-evans Looking for a response from you as we are highly depend on this to push our code to production. If my above explanation is not clear, I can set up a session with you. Please let me know what works.
from create-pull-request.
@peter-evans Kindly update on this.
from create-pull-request.
@peter-evans Please update on this. We are blocked on this.
from create-pull-request.
@Poornachand200 It looks like the latest changes you made to the workflow are following the example here, so that part looks fine.
The problem seems to be that you want to ignore parts of the diff for some paths. For that you should use the add-paths
input, but you will need to change the value of the input based on the value of inputs.product
.
The other alternative is to create your own commits, and then discard any changes that you don't want.
I'm very busy at the moment and that's about all I have time for to help you with this.
I'll close this now because this isn't an issue with the action itself, it's just general support for using the action. I try to help with these type of requests, but I don't have a lot of time to provide support in my spare time.
from create-pull-request.
Related Issues (20)
- Default to "Squash and Merge" HOT 1
- I get error "protected branch hook declined" when I try to create a draft pull request into protected branch HOT 1
- Force update the branch of existing pull request HOT 1
- Empty PRs being created, is this expected? HOT 4
- Error creating new PR HOT 2
- `title-path` and `commit-message-path` inputs HOT 1
- `base` also does a checkout to that branch HOT 1
- Update multiple repositories HOT 2
- ignore untracked HOT 2
- NO PR created and branch changes to new branch and updates from main HOT 5
- Required checks are not being triggered after the PR creation HOT 1
- Error: Input 'token' not supplied. Unable to continue. HOT 1
- Node version - Warning HOT 1
- Permission denied (publickey) HOT 1
- Merge conflict error for different files with different names
- Add branch-label as an output so it can be passed to other actions and easily commited to HOT 2
- PR still created with 0 files (no diffs)
- [FEATURE] Add ability to enable auto-merge
- Can't figure out how to include commits made during workflow
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-pull-request.