Code Monkey home page Code Monkey logo

Comments (2)

peter-evans avatar peter-evans commented on August 20, 2024

Hi @pauliver

If you want to create a pull request that will be merged into the gh-pages branch then that branch is the base, not branch. My understanding of your use case is to keep the gh-pages branch up-to-date with master by raising PRs when there are changes. If that is the case, please try the following instead.

  create_pr_if_success:
    name: Create PR to gh-pages if everything works
    needs: [process_images, build_jekyll_site]
    runs-on: [ubuntu-latest]
    strategy:
      matrix:
        dotnet: [ '3.1.100' ]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: ${{env.GHPages}}
      - name: Reset GitHub Pages branch
        run: |
          git fetch origin master:master
          git reset --hard master
      - name: Create Pull Request
        uses: peter-evans/[email protected] #https://github.com/marketplace/actions/create-pull-request
        with:
          branch: github-pages-promotion
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-message: "tests all passed, creating PR for ${{env.GHPages}}"
          labels: ${{env.AutoMergeLabel}}

The workflow first checks out the gh-pages branch, because this is the base of the pull request. It then resets the branch to match master. If there are changes, the action will raise a PR to update the gh-pages branch. The pull request branch is called github-pages-promotion. When the PR is merged or closed, the github-pages-promotion branch can be deleted without affecting gh-pages or master.

from create-pull-request.

peter-evans avatar peter-evans commented on August 20, 2024

@pauliver Closing this issue for now. Please let me know if it doesn't solve your problem.

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.