Skip to content

Commit

Permalink
4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-yurchenko committed Dec 15, 2021
1 parent c35ea2d commit 6e9f5aa
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ updates:
- anton-yurchenko
labels:
- dependencies

- package-ecosystem: npm
directory: "/"
schedule:
Expand All @@ -18,6 +19,7 @@ updates:
- anton-yurchenko
labels:
- dependencies

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [4.2.1] - 2021-12-15
### Fixed
- Error uploading an asset during retry loop

## [4.2.0] - 2021-11-25
### Added
- Retry assets uploads
Expand Down Expand Up @@ -228,7 +232,7 @@ This is a major release as most of the code was refactored and some behavior was
- Control Release Draft through env.var 'DRAFT_RELEASE'
- Control Release Pre Release through env.var 'PRE_RELEASE'

[Unreleased]: https://github.com/anton-yurchenko/git-release/compare/v4.2.0...HEAD
[4.2.1]: https://github.com/anton-yurchenko/git-release/compare/v4.2.0...v4.2.1
[4.2.0]: https://github.com/anton-yurchenko/git-release/compare/v4.1.2...v4.2.0
[4.1.2]: https://github.com/anton-yurchenko/git-release/compare/v4.1.1...v4.1.2
[4.1.1]: https://github.com/anton-yurchenko/git-release/compare/v4.1.0...v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

// Version contains current application version
const Version string = "4.2.0"
const Version string = "4.2.1"

func init() {
log.SetReportCaller(false)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "git-release",
"version": "4.2.0",
"version": "4.2.1",
"description": "A GitHub Action for creating a GitHub Release with Assets and Changelog whenever a new Tag is pushed to the repository.",
"main": "wrapper.js",
"directories": {
Expand Down
14 changes: 7 additions & 7 deletions release/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ func (a *Asset) Upload(release *Release, cli RepositoriesClient, id int64, errs
defer wg.Done()
log.WithField("asset", a.Name).Info("uploading asset")

file, err := os.Open(a.Path)
if err != nil {
errs <- err
return
}
defer file.Close()

maxRetries := 4
for i := 1; i <= maxRetries; i++ {
file, err := os.Open(a.Path)
if err != nil {
errs <- err
return
}

_, _, err = cli.UploadReleaseAsset(
context.Background(),
release.Slug.Owner,
Expand All @@ -81,6 +80,7 @@ func (a *Asset) Upload(release *Release, cli RepositoriesClient, id int64, errs
file,
)

file.Close()
if err == nil {
errs <- nil
break
Expand Down

0 comments on commit 6e9f5aa

Please sign in to comment.