Code Monkey home page Code Monkey logo

Comments (10)

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@peter-evans Could you please help me here

from create-pull-request.

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@peter-evans Its a blocker for the current development. Could you please assist me?

from create-pull-request.

peter-evans avatar peter-evans commented on July 18, 2024

Hi @Poornachand200

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.

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@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.

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@peter-evans Hope the explanation in the above comment helps.

from create-pull-request.

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@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.

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@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.

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@peter-evans Kindly update on this.

from create-pull-request.

Poornachand200 avatar Poornachand200 commented on July 18, 2024

@peter-evans Please update on this. We are blocked on this.

from create-pull-request.

peter-evans avatar peter-evans commented on July 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.