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

DEV: Add body to created GitHub release #1985

Merged
merged 9 commits into from
Jul 20, 2023
Merged

Conversation

MasterOdin
Copy link
Member

@MasterOdin MasterOdin commented Jul 19, 2023

Closes #1971

PR fixes that new GitHub releases were lacking a body, where this was due to the fact that we were not outputting tag_body to $GITHUB_ENV so that it wasn't available in follow-up steps. However, because the body is a multiline string, we've got to wrap it in special syntax to get it to work (see docs for example).

See https://github.com/py-pdf/pypdf/actions/runs/5601580443/jobs/10245662760?pr=1985 as an example test run that shows it working in a test workflow.

@MasterOdin MasterOdin requested a review from MartinThoma July 19, 2023 15:41
@MasterOdin
Copy link
Member Author

Oh, I had missed this comment (#1970 (comment)), which seems to indicate that having it be a multiline string was causing it to be not properly passed forward. Will test this a bit, before marking this ready for review.

@MasterOdin MasterOdin marked this pull request as draft July 19, 2023 15:46
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (c2a741e) 93.87% compared to head (5df7599) 93.87%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1985   +/-   ##
=======================================
  Coverage   93.87%   93.87%           
=======================================
  Files          33       33           
  Lines        7009     7009           
  Branches     1394     1394           
=======================================
  Hits         6580     6580           
  Misses        276      276           
  Partials      153      153           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MasterOdin MasterOdin marked this pull request as ready for review July 19, 2023 16:20
@MasterOdin
Copy link
Member Author

Alright, now I think I've got it working, and this should be ready for review/merge.

@MartinThoma
Copy link
Member

Thanks for trying it, but I think it's still not working.

This is what I setup to test it: https://github.com/py-pdf/pdfly/pull/22/files

I tried 24 variations of the same thing. Nothing worked.

I read:

Your variation seems to give an empty environment variable. The result looks like this:

image

@MartinThoma
Copy link
Member

The expected result is:

$ latest_tag=0.2.14 
$ git --no-pager tag tag -l "${latest_tag}" --format='%(contents:body)'   
# What's changed

Nothing. See #1.

[Nothing](https://rickroll.it/)

@MasterOdin
Copy link
Member Author

MasterOdin commented Jul 19, 2023

I think that your local history does not match the remote history. When looking at the 0.2.14 release, it points at py-pdf/pdfly@7d0bc54, which only has subject and no body. As such, doing git tag -l "${latest_tag}" --format='%(contents:body)' returns blank because there is no body. In the case of a blank release body, then GH defaults to showing the commit as is, which is why you see REL: 0.2.13 because that's the only thing in that commit...

Looking through the history for that project, there's no commit that has your expected body, so I'd be very surprised to ever see it show up.

@MasterOdin
Copy link
Member Author

I would add that all of the commits in the PR you linked also do not have any bodies (they only have the subject line), so it's also expected then that tag_body would always be blank.

@MartinThoma MartinThoma merged commit 6df64af into main Jul 20, 2023
@MartinThoma MartinThoma deleted the MasterOdin-patch-1 branch July 20, 2023 21:53
@MartinThoma
Copy link
Member

Thank you 🤗

I had indeed different git tags locally than remotely 👍 I have no clue how that happened ... that did cost me a ton of time. Likely many of the things I tried were working, but I thought they were failing because the tag was empty 🤦‍♂️

MartinThoma added a commit that referenced this pull request Jul 23, 2023
New Features (ENH):
-  Add is_open in outlines in PdfReader and PdfWriter (#1960)

Bug Fixes (BUG):
-  Search /DA in hierarchy fields (#2002)
-  Cope with different ISO date length (#1999)
-  Decode Black only/CMYK deviceN images (#1984)
-  Process CMYK in deflate images (#1977)

Developer Experience (DEV):
-  Add mypy to pre-commit (#2001)
-  Release automation (#1991, #1985)

[Full Changelog](3.12.2...3.13.0)
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.

DEV: Add body to created GitHub release
2 participants