Skip to content

Commit

Permalink
Merge pull request #13770 from prometheus/superq/sync_description
Browse files Browse the repository at this point in the history
Add container_description.yml to repo sync
  • Loading branch information
SuperQ committed Mar 14, 2024
2 parents 1de49d5 + a0fbc75 commit 537ce87
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container_description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

PushQuayIoReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
name: Push README to quay.io
steps:
- name: git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
15 changes: 14 additions & 1 deletion scripts/sync_repo_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [ -z "${GITHUB_TOKEN}" ]; then
fi

# List of files that should be synced.
SYNC_FILES="CODE_OF_CONDUCT.md LICENSE Makefile.common SECURITY.md .yamllint scripts/golangci-lint.yml .github/workflows/scorecards.yml"
SYNC_FILES="CODE_OF_CONDUCT.md LICENSE Makefile.common SECURITY.md .yamllint scripts/golangci-lint.yml .github/workflows/scorecards.yml .github/workflows/container_description.yml"

# Go to the root of the repo
cd "$(git rev-parse --show-cdup)" || exit 1
Expand Down Expand Up @@ -99,6 +99,15 @@ check_go() {
curl -sLf -o /dev/null "https://raw.githubusercontent.com/${org_repo}/${default_branch}/go.mod"
}

check_docker() {
local org_repo
local default_branch
org_repo="$1"
default_branch="$2"

curl -sLf -o /dev/null "https://raw.githubusercontent.com/${org_repo}/${default_branch}/Dockerfile"
}

process_repo() {
local org_repo
local default_branch
Expand All @@ -119,6 +128,10 @@ process_repo() {
echo "${org_repo} is not Go, skipping golangci-lint.yml."
continue
fi
if [[ "${source_file}" == '.github/workflows/container_description.yml' ]] && ! check_docker "${org_repo}" "${default_branch}" ; then
echo "${org_repo} has no Dockerfile, skipping container_description.yml."
continue
fi
if [[ "${source_file}" == 'LICENSE' ]] && ! check_license "${target_file}" ; then
echo "LICENSE in ${org_repo} is not apache, skipping."
continue
Expand Down

0 comments on commit 537ce87

Please sign in to comment.