Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone the profile's release.yml file if missing #1

Closed

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented May 14, 2024

If the .github/release.yml file is missing then this clones it from the profile repository. This allows setting an organization wide default without having to include the config in every repository.

Currently completely untested. Ideally it should also deal with the file not being present in the profile. Testing matrix:

missing in profile present in profile
present in repo
missing in repo

If the .github/release.yml file is missing then this clones it from the
profile repository. This allows setting an organization wide default
without having to include the config in every repository.
@ekohl ekohl requested a review from rwaffen May 14, 2024 19:41
@rwaffen
Copy link
Sponsor Member

rwaffen commented May 15, 2024

nice. this looks clean and simple!
and this checkout is tan locate in the local file system ".github/release.yml"? i will test this later on.

@rwaffen
Copy link
Sponsor Member

rwaffen commented May 31, 2024

this does not work. the gh command from the action does not use the local version of .github/release.yml. This is somehow done differently :[ . if the release.yml is not present in the repo before triggering the action it is completely ignored.

i changed it a bit and tried it a few times in my company org, but had no success at all :[

      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Check for local release.yml
        id: check_file
        run: |
          if [ ! -f .github/release.yml ]; then
            echo "RELEASE_YML_MISSING=true" >> $GITHUB_OUTPUT
          fi

      - name: Checkout Upstream-Repository (if release.yml is missing)
        uses: actions/checkout@v4
        if: steps.check_file.outputs.RELEASE_YML_MISSING == 'true'
        with:
          repository: "${{ github.repository_owner }}/.github"
          path: upstream
          sparse-checkout: .github/release.yml
          sparse-checkout-cone-mode: false

      - name: Copy release.yml (if missing)
        if: steps.check_file.outputs.RELEASE_YML_MISSING == 'true'
        run: |
          cp upstream/.github/release.yml .github/release.yml

      - name: Create Release Page
        shell: bash
        env:
          GH_TOKEN: ${{ github.token }}
        run: gh release create ${{ github.ref_name }} --generate-notes

@rwaffen
Copy link
Sponsor Member

rwaffen commented May 31, 2024

i think ill try this now:
https://github.com/marketplace/actions/file-sync

@ekohl
Copy link
Member Author

ekohl commented May 31, 2024

I don't even see where in https://github.com/cli/cli the file release.yml is used in the first place. https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes clearly describes this file, but what determines this? Is it done server side?

@rwaffen
Copy link
Sponsor Member

rwaffen commented May 31, 2024

I also didn't find where it is parsed/used. I also think it's some server side magic :[

@rwaffen rwaffen deleted the branch voxpupuli:main June 28, 2024 09:16
@rwaffen rwaffen closed this Jun 28, 2024
@ekohl ekohl deleted the clone-release-from-profile-if-missing branch June 28, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants