Skip to content

Commit 7c5962c

Browse files
authored
Merge branch 'main' into dependabot/github_actions/step-security/harden-runner-2.14.0
2 parents 6a4339a + 24ba023 commit 7c5962c

File tree

9 files changed

+309
-42
lines changed

9 files changed

+309
-42
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
run: sudo apt-get update && sudo apt-get install libxml2-utils
5757

5858
- name: Archive tpip report
59-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
59+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
6060
with:
6161
name: tpip-report
6262
path: ./build/cpackget-ubuntu-amd64.txt
@@ -80,7 +80,7 @@ jobs:
8080
egress-policy: audit
8181

8282
- name: Download Artifacts
83-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
83+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
8484
with:
8585
path: artifacts
8686

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
# Initializes the CodeQL tools for scanning.
5151
- name: Initialize CodeQL
52-
uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5
52+
uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5
5353
with:
5454
languages: ${{ matrix.language }}
5555
queries: security-and-quality
@@ -59,6 +59,6 @@ jobs:
5959
go build -o cpackget ./cmd
6060
6161
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5
62+
uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5
6363
with:
6464
category: "/language:${{matrix.language}}"

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
egress-policy: audit
3333

3434
- name: Download test results
35-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
35+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
3636
with:
3737
pattern: test-results-*
3838
path: testreport/

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ jobs:
6363
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6464
# format to the repository Actions tab.
6565
- name: "Upload artifact"
66-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
66+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
6767
with:
6868
name: SARIF file
6969
path: results.sarif
7070
retention-days: 5
7171

7272
# Upload the results to GitHub's code scanning dashboard.
7373
- name: "Upload to code-scanning"
74-
uses: github/codeql-action/upload-sarif@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5
74+
uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5
7575
with:
7676
sarif_file: results.sarif

.github/workflows/tpip-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
working-directory: ./cmd
4949

5050
- name: Archive tpip report
51-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
51+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5252
with:
5353
name: tpip-report
5454
path: ./${{ env.report_name }}
@@ -82,12 +82,12 @@ jobs:
8282
ref: ${{ github.event.pull_request.head.ref }}
8383

8484
- name: Restore Changes
85-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
85+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
8686
with:
8787
name: tpip-report
8888

8989
- name: Create Pull Request
90-
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
90+
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
9191
with:
9292
commit-message: Update TPIP report
9393
title: ':robot: [TPIP] Automated report updates'

cmd/installer/root.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -900,19 +900,21 @@ func UpdateInstalledPDSCFiles(pidxXML, cidxXML *xml.PidxXML, updatePrivatePdsc,
900900
func UpdatePublicIndexIfOnline() error {
901901
// If public index already exists then first check if online, then its timestamp
902902
// if we are online and it is too old then download a current version
903+
903904
if utils.FileExists(Installation.PublicIndex) {
904905
err := utils.CheckConnection(ConnectionTryURL, 0)
905906
if err != nil && errors.Unwrap(err) != errs.ErrOffline {
906-
return err
907+
log.Warnf("Cannot check for public index update: %v", err)
907908
}
908909
if errors.Unwrap(err) != errs.ErrOffline {
909910
var updateConf updateCfg
910-
err = Installation.checkUpdateCfg(&updateConf)
911+
err = Installation.checkUpdateCfg(&updateConf, true)
911912
if err != nil {
912913
UnlockPackRoot()
913914
err1 := UpdatePublicIndex(ActualPublicIndex, false, false, false, false, false, 0, 0)
914915
if err1 != nil {
915-
return err1
916+
log.Warnf("Cannot update public index: %v", err1)
917+
return nil
916918
}
917919
_ = Installation.updateUpdateCfg(&updateConf)
918920
}
@@ -925,7 +927,8 @@ func UpdatePublicIndexIfOnline() error {
925927
UnlockPackRoot()
926928
err1 := UpdatePublicIndex(ActualPublicIndex, false, false, false, false, false, 0, 0)
927929
if err1 != nil {
928-
return err1
930+
log.Warnf("Cannot update public index: %v", err1)
931+
return nil
929932
}
930933
var updateConf updateCfg
931934
updateConf.Auto = true
@@ -1385,9 +1388,9 @@ func ListInstalledPacks(listCached, listPublic, listUpdates, listRequirements, t
13851388
// 1.2.1. if pack's pdsc file not found in Installation.LocalDir then raise errs.ErrPackURLCannotBeFound
13861389
// 1.2.2. read .Local/PDSC file into pdscXML
13871390
// 1.2.3. releastTag = pdscXML.FindReleaseTagByVersion(pack.Version)
1388-
// 1.2.3. if releaseTag == nil then raise ErrPackVersionNotFoundInPdsc
1389-
// 1.2.4. if releaseTag.URL != "", return releaseTag.URL
1390-
// 1.2.5. return pdscTag.URL + pack.Vendor + "." + pack.Name + "." + pack.Version + ".pack"
1391+
// 1.2.4. if releaseTag == nil then raise ErrPackVersionNotFoundInPdsc
1392+
// 1.2.5. if releaseTag.URL != "", return releaseTag.URL
1393+
// 1.2.6. return pdscTag.URL + pack.Vendor + "." + pack.Name + "." + pack.Version + ".pack"
13911394
//
13921395
// The function resolves the version modifier to determine the correct version of the pack to fetch.
13931396
// It then checks the release tag for the specified version and returns the URL if found.
@@ -1747,14 +1750,18 @@ type updateCfg struct {
17471750
// Parameters:
17481751
// - conf (*updateCfg): A pointer to the updateCfg structure that will be populated
17491752
// with the parsed configuration values.
1753+
// - WarningInsteadOfErrors (bool): A flag indicating whether to log warnings instead of returning errors.
17501754
//
17511755
// Returns:
17521756
// - error: An error is returned if the "update.cfg" file cannot be opened, if the
17531757
// "Date" field cannot be parsed, or if the timestamp in the "Date" field is older
17541758
// than 24 hours. If no errors occur, nil is returned.
1755-
func (p *PacksInstallationType) checkUpdateCfg(conf *updateCfg) error {
1759+
func (p *PacksInstallationType) checkUpdateCfg(conf *updateCfg, WarningInsteadOfErrors bool) error {
17561760
f, err := os.Open(filepath.Join(p.WebDir, "update.cfg"))
17571761
if err != nil {
1762+
if WarningInsteadOfErrors {
1763+
log.Debugf("Could not open update.cfg: %v", err)
1764+
}
17581765
return err
17591766
}
17601767
defer f.Close()

0 commit comments

Comments
 (0)