vn7n24fzkq / github-profile-summary-cards

A tool to generate your github summary card for profile README
https://github-profile-summary-cards.vercel.app/demo
MIT License
2.6k stars 313 forks source link

Avoid action pushing to branch automatically #140

Closed MR-Addict closed 1 year ago

MR-Addict commented 1 year ago

Context

What are you trying to do and how would you want to do it differently? Is it something you currently you cannot do? Is this related to an issue/problem?

I want to push built files push to other branch manually, because I have other profile actions that generte static svg images. Automatically pushing feature will merge files pushed before.

Alternatives

Can you achieve the same result doing it in an alternative way? Is the alternative considerable?

When summary files generated, I can manually use other github actions push these files to destination branch together.

For example:

name: build

on:
  push:
    branches:
      - main
  schedule:
    - cron: "* */24 * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # generate snake svg image
      - name: generate snake
        uses: Platane/snk/svg-only@v2
        with:
          outputs: snake/snake.svg
          github_user_name: ${{ github.repository_owner }}
      # generate summary svg image
      - uses: vn7n24fzkq/github-profile-summary-cards@release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          USERNAME: ${{ github.repository_owner }}
      # merge generated files
      - name: merge files
        run: mkdir output & mv snake output && mv profile-3d-contrib output
      # push files to output branch
      - name: push builds to output branch
        uses: crazy-max/ghaction-github-pages@v3.1.0
        with:
          target_branch: output
          build_dir: output
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Has the feature been requested before?

Please provide a link to the issue.

No such request yet.

If the feature request is approved, would you be willing to submit a PR?

Yes / No (Help can be provided if you need assistance submitting a PR)

Yes, I'd like to.

vn7n24fzkq commented 1 year ago

Hey @MR-Addict, sorry for the late reply. We had already released a new version that supports pushing the result to different branches but cannot set the output dir, does this solve your problem? If not, we still can also try to make it support different output-dir I think. https://github.com/vn7n24fzkq/github-profile-summary-cards#github-actions-usage

MR-Addict commented 1 year ago

Thanks for you reply.

What I mean is that action should avoid automataically pushing to other branch. The action generates output files only so that I can manually push them with other generated files together to desired branch.

vn7n24fzkq commented 1 year ago

Oh, I see. I agree with you, but in the previous design, we made the commit and pushed behavior default to make the action be easy to use. If we change this, it may affect many users who are currently using this action. How about we add a variable to disable the auto-commit behavior? So we can manually push the result to a different branch. Maybe we can add a variable to disable automatic pushing and a variable to specify the output folder?

MR-Addict commented 1 year ago

It would be great if you could consider implementing such feature.

Thanks for your time and efforts.

vn7n24fzkq commented 1 year ago

Yes, I think we can implement this feature, would you like to make a PR for that? Currently, I haven't added the development document yet, so you may face some issues when you try to implement it. If you would, I will give you any help I can.

MR-Addict commented 1 year ago

Yes, I'm happy to have a try.

I will make a PR when I make some progress. And I may need your hand if I counter some problems.

MR-Addict commented 1 year ago

I had submit a PR yesterday. You could have a check.

vn7n24fzkq commented 1 year ago

Sorry for the late reply.

I was busy in a few days before, tomorrow I will take a look.

MR-Addict commented 1 year ago

Thankyou

vn7n24fzkq commented 1 year ago

Closed by #153

Thanks for the PR again.